├── .github └── workflows │ └── go.yml ├── .gitignore ├── LICENSE ├── README.md ├── cache ├── cache.go └── cache_test.go ├── card ├── card.go ├── card_test.go └── model.go ├── changelog.md ├── client.go ├── core ├── apireq.go ├── apiresp.go ├── appticketmanager.go ├── appticketmanager_test.go ├── cache.go ├── cache_test.go ├── config.go ├── constants.go ├── errors.go ├── httpclient.go ├── httpclient_test.go ├── httpserverext │ ├── httpserverext.go │ └── httpserverext_test.go ├── httptransport.go ├── httptransport_test.go ├── logger.go ├── reqoption.go ├── reqtranslator.go ├── reqtranslator_test.go ├── serialization.go ├── tokenmanager.go ├── tokenmanager_test.go ├── utils.go ├── utils_test.go └── version.go ├── doc ├── console.jpeg ├── event_protocol.jpeg └── find_method.jpg ├── event ├── dispatcher │ ├── acs_v1_event_dispatch.go │ ├── application_v6_event_dispatch.go │ ├── approval_v4_event_dispatch.go │ ├── appticket_handler.go │ ├── calendar_v4_event_dispatch.go │ ├── callback │ │ ├── event.go │ │ └── model.go │ ├── callback_dispatch.go │ ├── contact_v3_event_dispatch.go │ ├── corehr_v1_event_dispatch.go │ ├── corehr_v2_event_dispatch.go │ ├── custom_appticket_handler.go │ ├── dispatcher.go │ ├── dispatcher_test.go │ ├── drive_v1_event_dispatch.go │ ├── ext_event_dispatch.go │ ├── helpdesk_v1_event_dispatch.go │ ├── hire_v1_event_dispatch.go │ ├── im_v1_event_dispatch.go │ ├── mail_v1_event_dispatch.go │ ├── meeting_room_v1_event_dispatch.go │ ├── moments_v1_event_dispatch.go │ ├── payroll_v1_event_dispatch.go │ ├── performance_v2_event_dispatch.go │ ├── task_v1_event_dispatch.go │ └── vc_v1_event_dispatch.go ├── event.go └── model.go ├── go.mod ├── go.sum ├── sample ├── api │ ├── application.go │ ├── bitable2.go │ ├── client.go │ ├── contact.go │ ├── docx.go │ ├── im │ │ └── im.go │ ├── okr.go │ ├── sheets.go │ └── token.go ├── apiall │ ├── acsv1 │ │ ├── create_ruleExternal.go │ │ ├── create_visitor.go │ │ ├── delete_ruleExternal.go │ │ ├── delete_visitor.go │ │ ├── deviceBind_ruleExternal.go │ │ ├── get_accessRecordAccessPhoto.go │ │ ├── get_ruleExternal.go │ │ ├── get_user.go │ │ ├── get_userFace.go │ │ ├── list_accessRecord.go │ │ ├── list_device.go │ │ ├── list_user.go │ │ ├── patch_user.go │ │ └── update_userFace.go │ ├── adminv1 │ │ ├── create_badge.go │ │ ├── create_badgeGrant.go │ │ ├── create_badgeImage.go │ │ ├── delete_badgeGrant.go │ │ ├── get_badge.go │ │ ├── get_badgeGrant.go │ │ ├── list_adminDeptStat.go │ │ ├── list_adminUserStat.go │ │ ├── list_auditInfo.go │ │ ├── list_badge.go │ │ ├── list_badgeGrant.go │ │ ├── reset_password.go │ │ ├── update_badge.go │ │ └── update_badgeGrant.go │ ├── ailyv1 │ │ ├── ask_appKnowledge.go │ │ ├── cancel_ailySessionRun.go │ │ ├── create_ailySession.go │ │ ├── create_ailySessionAilyMessage.go │ │ ├── create_ailySessionRun.go │ │ ├── create_appDataAsset.go │ │ ├── delete_ailySession.go │ │ ├── delete_appDataAsset.go │ │ ├── get_ailySession.go │ │ ├── get_ailySessionAilyMessage.go │ │ ├── get_ailySessionRun.go │ │ ├── get_appDataAsset.go │ │ ├── get_appSkill.go │ │ ├── list_ailySessionAilyMessage.go │ │ ├── list_ailySessionRun.go │ │ ├── list_appDataAsset.go │ │ ├── list_appDataAssetTag.go │ │ ├── list_appSkill.go │ │ ├── start_appSkill.go │ │ ├── update_ailySession.go │ │ └── uploadFile_appDataAsset.go │ ├── apaasv1 │ │ ├── addAssignee_approvalTask.go │ │ ├── agree_approvalTask.go │ │ ├── auditLogList_applicationAuditLog.go │ │ ├── batchCreateAuthorization_applicationRecordPermissionMember.go │ │ ├── batchCreateAuthorization_applicationRoleMember.go │ │ ├── batchCreate_applicationObjectRecord.go │ │ ├── batchDelete_applicationObjectRecord.go │ │ ├── batchQuery_applicationObjectRecord.go │ │ ├── batchRemoveAuthorization_applicationRecordPermissionMember.go │ │ ├── batchRemoveAuthorization_applicationRoleMember.go │ │ ├── batchUpdate_applicationObjectRecord.go │ │ ├── cancel_approvalInstance.go │ │ ├── cc_userTask.go │ │ ├── chatGroup_userTask.go │ │ ├── create_applicationObjectRecord.go │ │ ├── dataChangeLogDetail_applicationAuditLog.go │ │ ├── dataChangeLogsList_applicationAuditLog.go │ │ ├── delete_applicationObjectRecord.go │ │ ├── execute_applicationFlow.go │ │ ├── expediting_userTask.go │ │ ├── get_applicationAuditLog.go │ │ ├── get_applicationEnvironmentVariable.go │ │ ├── get_applicationRoleMember.go │ │ ├── invoke_applicationFunction.go │ │ ├── list_seatActivity.go │ │ ├── list_seatAssignment.go │ │ ├── oqlQuery_applicationObject.go │ │ ├── patch_applicationObjectRecord.go │ │ ├── query_applicationEnvironmentVariable.go │ │ ├── query_applicationObjectRecord.go │ │ ├── query_userTask.go │ │ ├── reject_approvalTask.go │ │ ├── rollbackPoints_userTask.go │ │ ├── rollback_userTask.go │ │ ├── search_applicationObject.go │ │ └── transfer_approvalTask.go │ ├── applicationv6 │ │ ├── apply_scope.go │ │ ├── checkWhiteBlackList_applicationVisibility.go │ │ ├── contactsRangeConfiguration_application.go │ │ ├── contactsRangeSuggest_applicationAppVersion.go │ │ ├── departmentOverview_applicationAppUsage.go │ │ ├── get_application.go │ │ ├── get_applicationAppVersion.go │ │ ├── get_applicationCollaborators.go │ │ ├── list_appRecommendRule.go │ │ ├── list_application.go │ │ ├── list_applicationAppVersion.go │ │ ├── list_applicationFeedback.go │ │ ├── list_scope.go │ │ ├── messagePushOverview_applicationAppUsage.go │ │ ├── overview_applicationAppUsage.go │ │ ├── patch_application.go │ │ ├── patch_applicationAppVersion.go │ │ ├── patch_applicationContactsRange.go │ │ ├── patch_applicationFeedback.go │ │ ├── patch_applicationVisibility.go │ │ ├── set_appBadge.go │ │ ├── underauditlist_application.go │ │ ├── update_applicationCollaborators.go │ │ ├── update_applicationManagement.go │ │ └── update_applicationOwner.go │ ├── approvalv4 │ │ ├── addSign_instance.go │ │ ├── approve_task.go │ │ ├── cancel_instance.go │ │ ├── cc_instance.go │ │ ├── check_externalInstance.go │ │ ├── create_approval.go │ │ ├── create_externalApproval.go │ │ ├── create_externalInstance.go │ │ ├── create_instance.go │ │ ├── create_instanceComment.go │ │ ├── delete_instanceComment.go │ │ ├── get_approval.go │ │ ├── get_externalApproval.go │ │ ├── get_instance.go │ │ ├── list_externalTask.go │ │ ├── list_instance.go │ │ ├── list_instanceComment.go │ │ ├── preview_instance.go │ │ ├── query_instance.go │ │ ├── query_task.go │ │ ├── reject_task.go │ │ ├── remove_instanceComment.go │ │ ├── resubmit_task.go │ │ ├── searchCc_instance.go │ │ ├── search_task.go │ │ ├── specifiedRollback_instance.go │ │ ├── subscribe_approval.go │ │ ├── transfer_task.go │ │ └── unsubscribe_approval.go │ ├── attendancev1 │ │ ├── batchCreateTemp_userDailyShift.go │ │ ├── batchCreate_userDailyShift.go │ │ ├── batchCreate_userFlow.go │ │ ├── batchDel_userFlow.go │ │ ├── create_group.go │ │ ├── create_shift.go │ │ ├── create_userApproval.go │ │ ├── create_userTaskRemedy.go │ │ ├── delReport_archiveRule.go │ │ ├── delete_group.go │ │ ├── delete_shift.go │ │ ├── download_file.go │ │ ├── get_group.go │ │ ├── get_leaveEmployExpireRecord.go │ │ ├── get_shift.go │ │ ├── get_userFlow.go │ │ ├── listUser_group.go │ │ ├── list_archiveRule.go │ │ ├── list_group.go │ │ ├── list_shift.go │ │ ├── modify_userSetting.go │ │ ├── patch_leaveAccrualRecord.go │ │ ├── process_approvalInfo.go │ │ ├── queryUserAllowedRemedys_userTaskRemedy.go │ │ ├── query_shift.go │ │ ├── query_userApproval.go │ │ ├── query_userDailyShift.go │ │ ├── query_userFlow.go │ │ ├── query_userSetting.go │ │ ├── query_userStatsData.go │ │ ├── query_userStatsField.go │ │ ├── query_userStatsView.go │ │ ├── query_userTask.go │ │ ├── query_userTaskRemedy.go │ │ ├── search_group.go │ │ ├── update_userStatsView.go │ │ ├── uploadReport_archiveRule.go │ │ ├── upload_file.go │ │ └── userStatsFieldsQuery_archiveRule.go │ ├── authenv1 │ │ ├── create_accessToken.go │ │ ├── create_oidcAccessToken.go │ │ ├── create_oidcRefreshAccessToken.go │ │ ├── create_refreshAccessToken.go │ │ └── get_userInfo.go │ ├── authv3 │ │ ├── create_appAccessToken.go │ │ ├── create_tenantAccessToken.go │ │ ├── internal_appAccessToken.go │ │ ├── internal_tenantAccessToken.go │ │ └── resend_appTicket.go │ ├── baikev1 │ │ ├── create_draft.go │ │ ├── create_entity.go │ │ ├── download_file.go │ │ ├── extract_entity.go │ │ ├── get_entity.go │ │ ├── highlight_entity.go │ │ ├── list_classification.go │ │ ├── list_entity.go │ │ ├── match_entity.go │ │ ├── search_entity.go │ │ ├── update_draft.go │ │ ├── update_entity.go │ │ └── upload_file.go │ ├── basev2 │ │ ├── create_appRole.go │ │ ├── list_appRole.go │ │ └── update_appRole.go │ ├── bitablev1 │ │ ├── batchCreate_appRoleMember.go │ │ ├── batchCreate_appTable.go │ │ ├── batchCreate_appTableRecord.go │ │ ├── batchDelete_appRoleMember.go │ │ ├── batchDelete_appTable.go │ │ ├── batchDelete_appTableRecord.go │ │ ├── batchGet_appTableRecord.go │ │ ├── batchUpdate_appTableRecord.go │ │ ├── copy_app.go │ │ ├── copy_appDashboard.go │ │ ├── create_app.go │ │ ├── create_appRole.go │ │ ├── create_appRoleMember.go │ │ ├── create_appTable.go │ │ ├── create_appTableField.go │ │ ├── create_appTableRecord.go │ │ ├── create_appTableView.go │ │ ├── delete_appRole.go │ │ ├── delete_appRoleMember.go │ │ ├── delete_appTable.go │ │ ├── delete_appTableField.go │ │ ├── delete_appTableRecord.go │ │ ├── delete_appTableView.go │ │ ├── get_app.go │ │ ├── get_appTableForm.go │ │ ├── get_appTableRecord.go │ │ ├── get_appTableView.go │ │ ├── list_appDashboard.go │ │ ├── list_appRole.go │ │ ├── list_appRoleMember.go │ │ ├── list_appTable.go │ │ ├── list_appTableField.go │ │ ├── list_appTableFormField.go │ │ ├── list_appTableRecord.go │ │ ├── list_appTableView.go │ │ ├── list_appWorkflow.go │ │ ├── patch_appTable.go │ │ ├── patch_appTableForm.go │ │ ├── patch_appTableFormField.go │ │ ├── patch_appTableView.go │ │ ├── search_appTableRecord.go │ │ ├── update_app.go │ │ ├── update_appRole.go │ │ ├── update_appTableField.go │ │ ├── update_appTableRecord.go │ │ └── update_appWorkflow.go │ ├── blockv2 │ │ ├── create_entity.go │ │ ├── create_message.go │ │ └── update_entity.go │ ├── boardv1 │ │ ├── downloadAsImage_whiteboard.go │ │ └── list_whiteboardNode.go │ ├── calendarv4 │ │ ├── batchDelete_calendarEventAttendee.go │ │ ├── create_calendar.go │ │ ├── create_calendarAcl.go │ │ ├── create_calendarEvent.go │ │ ├── create_calendarEventAttendee.go │ │ ├── create_calendarEventMeetingChat.go │ │ ├── create_calendarEventMeetingMinute.go │ │ ├── create_exchangeBinding.go │ │ ├── create_timeoffEvent.go │ │ ├── delete_calendar.go │ │ ├── delete_calendarAcl.go │ │ ├── delete_calendarEvent.go │ │ ├── delete_calendarEventMeetingChat.go │ │ ├── delete_exchangeBinding.go │ │ ├── delete_timeoffEvent.go │ │ ├── generateCaldavConf_setting.go │ │ ├── get_calendar.go │ │ ├── get_calendarEvent.go │ │ ├── get_exchangeBinding.go │ │ ├── instanceView_calendarEvent.go │ │ ├── instances_calendarEvent.go │ │ ├── list_calendar.go │ │ ├── list_calendarAcl.go │ │ ├── list_calendarEvent.go │ │ ├── list_calendarEventAttendee.go │ │ ├── list_calendarEventAttendeeChatMember.go │ │ ├── list_freebusy.go │ │ ├── patch_calendar.go │ │ ├── patch_calendarEvent.go │ │ ├── primary_calendar.go │ │ ├── reply_calendarEvent.go │ │ ├── search_calendar.go │ │ ├── search_calendarEvent.go │ │ ├── subscribe_calendar.go │ │ ├── subscription_calendar.go │ │ ├── subscription_calendarAcl.go │ │ ├── subscription_calendarEvent.go │ │ ├── unsubscribe_calendar.go │ │ ├── unsubscription_calendar.go │ │ ├── unsubscription_calendarAcl.go │ │ └── unsubscription_calendarEvent.go │ ├── cardkitv1 │ │ ├── batchUpdate_card.go │ │ ├── content_cardElement.go │ │ ├── create_card.go │ │ ├── create_cardElement.go │ │ ├── delete_cardElement.go │ │ ├── idConvert_card.go │ │ ├── patch_cardElement.go │ │ ├── settings_card.go │ │ ├── update_card.go │ │ └── update_cardElement.go │ ├── compensationv1 │ │ ├── list_changeReason.go │ │ ├── list_indicator.go │ │ ├── list_item.go │ │ ├── list_itemCategory.go │ │ ├── list_plan.go │ │ └── query_archive.go │ ├── contactv3 │ │ ├── add_groupMember.go │ │ ├── batchAdd_groupMember.go │ │ ├── batchCreate_functionalRoleMember.go │ │ ├── batchDelete_functionalRoleMember.go │ │ ├── batchGetId_user.go │ │ ├── batchRemove_groupMember.go │ │ ├── batch_department.go │ │ ├── batch_user.go │ │ ├── bindDepartment_unit.go │ │ ├── children_department.go │ │ ├── create_department.go │ │ ├── create_employeeTypeEnum.go │ │ ├── create_functionalRole.go │ │ ├── create_group.go │ │ ├── create_jobFamily.go │ │ ├── create_jobLevel.go │ │ ├── create_unit.go │ │ ├── create_user.go │ │ ├── delete_department.go │ │ ├── delete_employeeTypeEnum.go │ │ ├── delete_functionalRole.go │ │ ├── delete_group.go │ │ ├── delete_jobFamily.go │ │ ├── delete_jobLevel.go │ │ ├── delete_unit.go │ │ ├── delete_user.go │ │ ├── findByDepartment_user.go │ │ ├── get_department.go │ │ ├── get_functionalRoleMember.go │ │ ├── get_group.go │ │ ├── get_jobFamily.go │ │ ├── get_jobLevel.go │ │ ├── get_jobTitle.go │ │ ├── get_unit.go │ │ ├── get_user.go │ │ ├── get_workCity.go │ │ ├── listDepartment_unit.go │ │ ├── list_customAttr.go │ │ ├── list_department.go │ │ ├── list_employeeTypeEnum.go │ │ ├── list_functionalRoleMember.go │ │ ├── list_jobFamily.go │ │ ├── list_jobLevel.go │ │ ├── list_jobTitle.go │ │ ├── list_scope.go │ │ ├── list_unit.go │ │ ├── list_user.go │ │ ├── list_workCity.go │ │ ├── memberBelong_group.go │ │ ├── parent_department.go │ │ ├── patch_department.go │ │ ├── patch_group.go │ │ ├── patch_unit.go │ │ ├── patch_user.go │ │ ├── remove_groupMember.go │ │ ├── resurrect_user.go │ │ ├── scopes_functionalRoleMember.go │ │ ├── search_department.go │ │ ├── simplelist_group.go │ │ ├── simplelist_groupMember.go │ │ ├── unbindDepartmentChat_department.go │ │ ├── unbindDepartment_unit.go │ │ ├── updateDepartmentId_department.go │ │ ├── updateUserId_user.go │ │ ├── update_department.go │ │ ├── update_employeeTypeEnum.go │ │ ├── update_functionalRole.go │ │ ├── update_jobFamily.go │ │ ├── update_jobLevel.go │ │ └── update_user.go │ ├── corehrv1 │ │ ├── addEnumOption_commonDataMetaData.go │ │ ├── addRoleAssign_authorization.go │ │ ├── calendarByScope_leave.go │ │ ├── convert_commonDataId.go │ │ ├── create_company.go │ │ ├── create_contract.go │ │ ├── create_department.go │ │ ├── create_employeeType.go │ │ ├── create_employment.go │ │ ├── create_job.go │ │ ├── create_jobChange.go │ │ ├── create_jobData.go │ │ ├── create_jobFamily.go │ │ ├── create_jobLevel.go │ │ ├── create_leaveGrantingRecord.go │ │ ├── create_location.go │ │ ├── create_nationalIdType.go │ │ ├── create_person.go │ │ ├── create_workingHoursType.go │ │ ├── delete_company.go │ │ ├── delete_contract.go │ │ ├── delete_department.go │ │ ├── delete_employeeType.go │ │ ├── delete_employment.go │ │ ├── delete_job.go │ │ ├── delete_jobData.go │ │ ├── delete_jobFamily.go │ │ ├── delete_jobLevel.go │ │ ├── delete_leaveGrantingRecord.go │ │ ├── delete_location.go │ │ ├── delete_nationalIdType.go │ │ ├── delete_person.go │ │ ├── delete_preHire.go │ │ ├── delete_workingHoursType.go │ │ ├── editEnumOption_commonDataMetaData.go │ │ ├── getByParam_authorization.go │ │ ├── getByParam_customField.go │ │ ├── get_company.go │ │ ├── get_contract.go │ │ ├── get_countryRegion.go │ │ ├── get_currency.go │ │ ├── get_department.go │ │ ├── get_employeeType.go │ │ ├── get_file.go │ │ ├── get_job.go │ │ ├── get_jobData.go │ │ ├── get_jobFamily.go │ │ ├── get_jobLevel.go │ │ ├── get_location.go │ │ ├── get_nationalIdType.go │ │ ├── get_person.go │ │ ├── get_preHire.go │ │ ├── get_processFormVariableData.go │ │ ├── get_subdivision.go │ │ ├── get_subregion.go │ │ ├── get_workingHoursType.go │ │ ├── leaveBalances_leave.go │ │ ├── leaveRequestHistory_leave.go │ │ ├── leaveTypes_leave.go │ │ ├── listObjectApiName_customField.go │ │ ├── list_company.go │ │ ├── list_contract.go │ │ ├── list_countryRegion.go │ │ ├── list_currency.go │ │ ├── list_department.go │ │ ├── list_employeeType.go │ │ ├── list_job.go │ │ ├── list_jobData.go │ │ ├── list_jobFamily.go │ │ ├── list_jobLevel.go │ │ ├── list_location.go │ │ ├── list_nationalIdType.go │ │ ├── list_preHire.go │ │ ├── list_securityGroup.go │ │ ├── list_subdivision.go │ │ ├── list_subregion.go │ │ ├── list_workingHoursType.go │ │ ├── match_compensationStandard.go │ │ ├── patch_company.go │ │ ├── patch_contract.go │ │ ├── patch_department.go │ │ ├── patch_employeeType.go │ │ ├── patch_employment.go │ │ ├── patch_job.go │ │ ├── patch_jobData.go │ │ ├── patch_jobFamily.go │ │ ├── patch_jobLevel.go │ │ ├── patch_nationalIdType.go │ │ ├── patch_person.go │ │ ├── patch_preHire.go │ │ ├── patch_workingHoursType.go │ │ ├── query_authorization.go │ │ ├── query_customField.go │ │ ├── query_offboarding.go │ │ ├── query_securityGroup.go │ │ ├── query_transferReason.go │ │ ├── query_transferType.go │ │ ├── removeRoleAssign_authorization.go │ │ ├── search_assignedUser.go │ │ ├── search_offboarding.go │ │ ├── submit_offboarding.go │ │ ├── updateRoleAssign_authorization.go │ │ ├── upload_person.go │ │ ├── workCalendarDate_leave.go │ │ └── workCalendar_leave.go │ ├── corehrv2 │ │ ├── active_company.go │ │ ├── active_customOrg.go │ │ ├── active_location.go │ │ ├── batchDelete_reportDetailRow.go │ │ ├── batchDelete_workforcePlanDetailRow.go │ │ ├── batchGet_company.go │ │ ├── batchGet_department.go │ │ ├── batchGet_employee.go │ │ ├── batchGet_employeesBp.go │ │ ├── batchGet_employeesJobData.go │ │ ├── batchGet_jobFamily.go │ │ ├── batchGet_jobLevel.go │ │ ├── batchGet_location.go │ │ ├── batchQuery_costAllocation.go │ │ ├── batchQuery_defaultCostCenter.go │ │ ├── batchSave_reportDetailRow.go │ │ ├── batchSave_workforcePlanDetailRow.go │ │ ├── batchV2_workforcePlanDetail.go │ │ ├── batch_employeesAdditionalJob.go │ │ ├── batch_workforcePlanDetail.go │ │ ├── complete_preHire.go │ │ ├── createVersion_costAllocation.go │ │ ├── createVersion_defaultCostCenter.go │ │ ├── create_costCenter.go │ │ ├── create_costCenterVersion.go │ │ ├── create_customOrg.go │ │ ├── create_employee.go │ │ ├── create_employeesAdditionalJob.go │ │ ├── create_jobChange.go │ │ ├── create_jobGrade.go │ │ ├── create_locationAddress.go │ │ ├── create_person.go │ │ ├── create_preHire.go │ │ ├── create_probationAssessment.go │ │ ├── deleteOrg_customOrg.go │ │ ├── delete_costCenter.go │ │ ├── delete_costCenterVersion.go │ │ ├── delete_department.go │ │ ├── delete_employeesAdditionalJob.go │ │ ├── delete_jobGrade.go │ │ ├── delete_locationAddress.go │ │ ├── delete_preHire.go │ │ ├── delete_probationAssessment.go │ │ ├── edit_offboarding.go │ │ ├── enableDisableAssessment_probation.go │ │ ├── getByDepartment_bp.go │ │ ├── get_approvalGroups.go │ │ ├── get_job.go │ │ ├── get_process.go │ │ ├── get_processFormVariableData.go │ │ ├── list_approver.go │ │ ├── list_bp.go │ │ ├── list_job.go │ │ ├── list_process.go │ │ ├── list_workforcePlan.go │ │ ├── openQueryDepartmentChangeListByIds_approvalGroups.go │ │ ├── openQueryJobChangeListByIds_approvalGroups.go │ │ ├── parents_department.go │ │ ├── patch_costCenter.go │ │ ├── patch_costCenterVersion.go │ │ ├── patch_customOrg.go │ │ ├── patch_department.go │ │ ├── patch_employeesAdditionalJob.go │ │ ├── patch_jobGrade.go │ │ ├── patch_location.go │ │ ├── patch_locationAddress.go │ │ ├── patch_person.go │ │ ├── patch_preHire.go │ │ ├── patch_probationAssessment.go │ │ ├── queryMultiTimeline_department.go │ │ ├── queryOperationLogs_department.go │ │ ├── queryRecentChange_company.go │ │ ├── queryRecentChange_costCenter.go │ │ ├── queryRecentChange_customOrg.go │ │ ├── queryRecentChange_department.go │ │ ├── queryRecentChange_job.go │ │ ├── queryRecentChange_jobFamily.go │ │ ├── queryRecentChange_jobGrade.go │ │ ├── queryRecentChange_jobLevel.go │ │ ├── queryRecentChange_location.go │ │ ├── queryTimeline_department.go │ │ ├── query_customOrg.go │ │ ├── query_employeesJobData.go │ │ ├── query_jobGrade.go │ │ ├── query_preHire.go │ │ ├── removeVersion_costAllocation.go │ │ ├── removeVersion_defaultCostCenter.go │ │ ├── restoreFlowInstance_preHire.go │ │ ├── revoke_jobChange.go │ │ ├── revoke_offboarding.go │ │ ├── search_basicInfoBank.go │ │ ├── search_basicInfoBankBranch.go │ │ ├── search_basicInfoCity.go │ │ ├── search_basicInfoCountryRegion.go │ │ ├── search_basicInfoCountryRegionSubdivision.go │ │ ├── search_basicInfoCurrency.go │ │ ├── search_basicInfoDistrict.go │ │ ├── search_basicInfoLanguage.go │ │ ├── search_basicInfoNationality.go │ │ ├── search_basicInfoTimeZone.go │ │ ├── search_contract.go │ │ ├── search_costCenter.go │ │ ├── search_department.go │ │ ├── search_employee.go │ │ ├── search_enum.go │ │ ├── search_jobChange.go │ │ ├── search_preHire.go │ │ ├── search_probation.go │ │ ├── submitV2_offboarding.go │ │ ├── submit_probation.go │ │ ├── transitTask_preHire.go │ │ ├── tree_department.go │ │ ├── updateRule_customOrg.go │ │ ├── updateVersion_costAllocation.go │ │ ├── updateVersion_defaultCostCenter.go │ │ ├── update_processApprover.go │ │ ├── update_processExtra.go │ │ ├── update_processRevoke.go │ │ ├── update_processTransfer.go │ │ ├── update_processWithdraw.go │ │ ├── withdrawOnboarding_preHire.go │ │ └── withdraw_probation.go │ ├── docsv1 │ │ └── get_content.go │ ├── document_aiv1 │ │ ├── fieldExtraction_contract.go │ │ ├── parse_resume.go │ │ ├── recognize_bankCard.go │ │ ├── recognize_businessCard.go │ │ ├── recognize_businessLicense.go │ │ ├── recognize_chinesePassport.go │ │ ├── recognize_drivingLicense.go │ │ ├── recognize_foodManageLicense.go │ │ ├── recognize_foodProduceLicense.go │ │ ├── recognize_healthCertificate.go │ │ ├── recognize_hkmMainlandTravelPermit.go │ │ ├── recognize_idCard.go │ │ ├── recognize_taxiInvoice.go │ │ ├── recognize_trainInvoice.go │ │ ├── recognize_twMainlandTravelPermit.go │ │ ├── recognize_vatInvoice.go │ │ ├── recognize_vehicleInvoice.go │ │ └── recognize_vehicleLicense.go │ ├── docxv1 │ │ ├── batchDelete_chatAnnouncementBlockChildren.go │ │ ├── batchDelete_documentBlockChildren.go │ │ ├── batchUpdate_chatAnnouncementBlock.go │ │ ├── batchUpdate_documentBlock.go │ │ ├── create_chatAnnouncementBlockChildren.go │ │ ├── create_document.go │ │ ├── create_documentBlockChildren.go │ │ ├── create_documentBlockDescendant.go │ │ ├── get_chatAnnouncement.go │ │ ├── get_chatAnnouncementBlock.go │ │ ├── get_chatAnnouncementBlockChildren.go │ │ ├── get_document.go │ │ ├── get_documentBlock.go │ │ ├── get_documentBlockChildren.go │ │ ├── list_chatAnnouncementBlock.go │ │ ├── list_documentBlock.go │ │ ├── patch_documentBlock.go │ │ └── rawContent_document.go │ ├── drivev1 │ │ ├── auth_permissionMember.go │ │ ├── batchCreate_permissionMember.go │ │ ├── batchGetTmpDownloadUrl_media.go │ │ ├── batchQuery_fileComment.go │ │ ├── batchQuery_meta.go │ │ ├── copy_file.go │ │ ├── createFolder_file.go │ │ ├── createShortcut_file.go │ │ ├── create_exportTask.go │ │ ├── create_fileComment.go │ │ ├── create_fileSubscription.go │ │ ├── create_fileVersion.go │ │ ├── create_importTask.go │ │ ├── create_permissionMember.go │ │ ├── create_permissionPublicPassword.go │ │ ├── deleteSubscribe_file.go │ │ ├── delete_file.go │ │ ├── delete_fileCommentReply.go │ │ ├── delete_fileVersion.go │ │ ├── delete_permissionMember.go │ │ ├── delete_permissionPublicPassword.go │ │ ├── download_exportTask.go │ │ ├── download_file.go │ │ ├── download_media.go │ │ ├── getSubscribe_file.go │ │ ├── get_exportTask.go │ │ ├── get_fileComment.go │ │ ├── get_fileStatistics.go │ │ ├── get_fileSubscription.go │ │ ├── get_fileVersion.go │ │ ├── get_importTask.go │ │ ├── get_permissionPublic.go │ │ ├── list_file.go │ │ ├── list_fileComment.go │ │ ├── list_fileCommentReply.go │ │ ├── list_fileVersion.go │ │ ├── list_fileViewRecord.go │ │ ├── list_permissionMember.go │ │ ├── move_file.go │ │ ├── patch_fileComment.go │ │ ├── patch_fileSubscription.go │ │ ├── patch_permissionPublic.go │ │ ├── subscribe_file.go │ │ ├── taskCheck_file.go │ │ ├── transferOwner_permissionMember.go │ │ ├── update_fileCommentReply.go │ │ ├── update_permissionMember.go │ │ ├── update_permissionPublicPassword.go │ │ ├── uploadAll_file.go │ │ ├── uploadAll_media.go │ │ ├── uploadFinish_file.go │ │ ├── uploadFinish_media.go │ │ ├── uploadPart_file.go │ │ ├── uploadPart_media.go │ │ ├── uploadPrepare_file.go │ │ └── uploadPrepare_media.go │ ├── drivev2 │ │ ├── get_permissionPublic.go │ │ ├── list_fileLike.go │ │ └── patch_permissionPublic.go │ ├── ehrv1 │ │ ├── get_attachment.go │ │ └── list_employee.go │ ├── eventv1 │ │ └── list_outboundIp.go │ ├── helpdeskv1 │ │ ├── agentEmail_agent.go │ │ ├── answerUserQuery_ticket.go │ │ ├── cancelApprove_notification.go │ │ ├── cancelSend_notification.go │ │ ├── create_agentSchedule.go │ │ ├── create_agentSkill.go │ │ ├── create_botMessage.go │ │ ├── create_category.go │ │ ├── create_faq.go │ │ ├── create_notification.go │ │ ├── create_ticketCustomizedField.go │ │ ├── create_ticketMessage.go │ │ ├── customizedFields_ticket.go │ │ ├── delete_agentSchedules.go │ │ ├── delete_agentSkill.go │ │ ├── delete_category.go │ │ ├── delete_faq.go │ │ ├── delete_ticketCustomizedField.go │ │ ├── executeSend_notification.go │ │ ├── faqImage_faq.go │ │ ├── get_agentSchedules.go │ │ ├── get_agentSkill.go │ │ ├── get_category.go │ │ ├── get_faq.go │ │ ├── get_notification.go │ │ ├── get_ticket.go │ │ ├── get_ticketCustomizedField.go │ │ ├── list_agentSchedule.go │ │ ├── list_agentSkill.go │ │ ├── list_agentSkillRule.go │ │ ├── list_category.go │ │ ├── list_faq.go │ │ ├── list_ticket.go │ │ ├── list_ticketCustomizedField.go │ │ ├── list_ticketMessage.go │ │ ├── patch_agent.go │ │ ├── patch_agentSchedules.go │ │ ├── patch_agentSkill.go │ │ ├── patch_category.go │ │ ├── patch_faq.go │ │ ├── patch_notification.go │ │ ├── patch_ticketCustomizedField.go │ │ ├── preview_notification.go │ │ ├── search_faq.go │ │ ├── startService_ticket.go │ │ ├── submitApprove_notification.go │ │ ├── subscribe_event.go │ │ ├── ticketImage_ticket.go │ │ ├── unsubscribe_event.go │ │ └── update_ticket.go │ ├── hirev1 │ │ ├── addToFolder_talent.go │ │ ├── batchChangeTalentPool_talentPool.go │ │ ├── batchDelete_ecoAccountCustomField.go │ │ ├── batchDelete_ecoBackgroundCheckCustomField.go │ │ ├── batchDelete_ecoBackgroundCheckPackage.go │ │ ├── batchDelete_ecoExamPaper.go │ │ ├── batchGetId_talent.go │ │ ├── batchQuery_agency.go │ │ ├── batchQuery_externalBackgroundCheck.go │ │ ├── batchQuery_externalInterview.go │ │ ├── batchQuery_externalOffer.go │ │ ├── batchUpdate_ecoAccountCustomField.go │ │ ├── batchUpdate_ecoBackgroundCheckCustomField.go │ │ ├── batchUpdate_ecoBackgroundCheckPackage.go │ │ ├── batchUpdate_ecoExamPaper.go │ │ ├── batchUpdate_jobManager.go │ │ ├── cancelOnboard_application.go │ │ ├── cancel_ecoBackgroundCheck.go │ │ ├── changeTalentBlock_talentBlocklist.go │ │ ├── close_job.go │ │ ├── combinedCreate_job.go │ │ ├── combinedCreate_talent.go │ │ ├── combinedUpdate_job.go │ │ ├── combinedUpdate_talent.go │ │ ├── config_job.go │ │ ├── createByAttachment_websiteDelivery.go │ │ ├── createByResume_websiteDelivery.go │ │ ├── create_application.go │ │ ├── create_attachment.go │ │ ├── create_ecoAccountCustomField.go │ │ ├── create_ecoBackgroundCheckCustomField.go │ │ ├── create_ecoBackgroundCheckPackage.go │ │ ├── create_ecoExamPaper.go │ │ ├── create_exam.go │ │ ├── create_externalApplication.go │ │ ├── create_externalBackgroundCheck.go │ │ ├── create_externalInterview.go │ │ ├── create_externalInterviewAssessment.go │ │ ├── create_externalOffer.go │ │ ├── create_externalReferralReward.go │ │ ├── create_jobRequirement.go │ │ ├── create_note.go │ │ ├── create_offer.go │ │ ├── create_referralAccount.go │ │ ├── create_talentExternalInfo.go │ │ ├── create_tripartiteAgreement.go │ │ ├── create_websiteChannel.go │ │ ├── create_websiteSiteUser.go │ │ ├── deactivate_referralAccount.go │ │ ├── delete_externalApplication.go │ │ ├── delete_externalBackgroundCheck.go │ │ ├── delete_externalInterview.go │ │ ├── delete_externalOffer.go │ │ ├── delete_externalReferralReward.go │ │ ├── delete_jobRequirement.go │ │ ├── delete_note.go │ │ ├── delete_tripartiteAgreement.go │ │ ├── delete_websiteChannel.go │ │ ├── enable_referralAccount.go │ │ ├── getAccountAssets_referralAccount.go │ │ ├── getAgencyAccount_agency.go │ │ ├── getByApplication_employee.go │ │ ├── getByApplication_referral.go │ │ ├── getByTalent_interview.go │ │ ├── getDetail_application.go │ │ ├── getDetail_job.go │ │ ├── get_agency.go │ │ ├── get_application.go │ │ ├── get_attachment.go │ │ ├── get_employee.go │ │ ├── get_interviewRecord.go │ │ ├── get_interviewRecordAttachment.go │ │ ├── get_job.go │ │ ├── get_jobManager.go │ │ ├── get_minutes.go │ │ ├── get_note.go │ │ ├── get_offer.go │ │ ├── get_offerApplicationForm.go │ │ ├── get_offerSchema.go │ │ ├── get_referralWebsiteJobPost.go │ │ ├── get_role.go │ │ ├── get_talent.go │ │ ├── get_websiteDeliveryTask.go │ │ ├── get_websiteJobPost.go │ │ ├── internOfferStatus_offer.go │ │ ├── listById_jobRequirement.go │ │ ├── list_application.go │ │ ├── list_applicationInterview.go │ │ ├── list_backgroundCheckOrder.go │ │ ├── list_evaluation.go │ │ ├── list_evaluationTask.go │ │ ├── list_examMarkingTask.go │ │ ├── list_externalApplication.go │ │ ├── list_interview.go │ │ ├── list_interviewFeedbackForm.go │ │ ├── list_interviewRecord.go │ │ ├── list_interviewRegistrationSchema.go │ │ ├── list_interviewRoundType.go │ │ ├── list_interviewTask.go │ │ ├── list_interviewer.go │ │ ├── list_job.go │ │ ├── list_jobFunction.go │ │ ├── list_jobProcess.go │ │ ├── list_jobRequirement.go │ │ ├── list_jobRequirementSchema.go │ │ ├── list_jobSchema.go │ │ ├── list_jobType.go │ │ ├── list_location.go │ │ ├── list_note.go │ │ ├── list_offer.go │ │ ├── list_offerApplicationForm.go │ │ ├── list_questionnaire.go │ │ ├── list_referralWebsiteJobPost.go │ │ ├── list_registrationSchema.go │ │ ├── list_resumeSource.go │ │ ├── list_role.go │ │ ├── list_subject.go │ │ ├── list_talent.go │ │ ├── list_talentFolder.go │ │ ├── list_talentTag.go │ │ ├── list_terminationReason.go │ │ ├── list_todo.go │ │ ├── list_tripartiteAgreement.go │ │ ├── list_userRole.go │ │ ├── list_website.go │ │ ├── list_websiteChannel.go │ │ ├── list_websiteJobPost.go │ │ ├── loginInfo_ecoExam.go │ │ ├── moveTalent_talentPool.go │ │ ├── offerStatus_offer.go │ │ ├── offer_application.go │ │ ├── onboardStatus_talent.go │ │ ├── open_job.go │ │ ├── operateAgencyAccount_agency.go │ │ ├── patch_ehrImportTask.go │ │ ├── patch_employee.go │ │ ├── patch_externalInterviewAssessment.go │ │ ├── patch_interviewer.go │ │ ├── patch_note.go │ │ ├── preview_attachment.go │ │ ├── protectSearch_agency.go │ │ ├── protect_agency.go │ │ ├── publish_advertisement.go │ │ ├── query_agency.go │ │ ├── query_location.go │ │ ├── query_talentObject.go │ │ ├── reconciliation_referralAccount.go │ │ ├── recover_application.go │ │ ├── recruiter_job.go │ │ ├── removeToFolder_talent.go │ │ ├── search_diversityInclusion.go │ │ ├── search_jobPublishRecord.go │ │ ├── search_referral.go │ │ ├── search_talentOperationLog.go │ │ ├── search_talentPool.go │ │ ├── search_test.go │ │ ├── search_websiteJobPost.go │ │ ├── tag_talent.go │ │ ├── terminate_application.go │ │ ├── transferOnboard_application.go │ │ ├── transferStage_application.go │ │ ├── updateConfig_job.go │ │ ├── updateProgress_ecoBackgroundCheck.go │ │ ├── updateResult_ecoBackgroundCheck.go │ │ ├── updateResult_ecoExam.go │ │ ├── update_externalApplication.go │ │ ├── update_externalBackgroundCheck.go │ │ ├── update_externalInterview.go │ │ ├── update_externalOffer.go │ │ ├── update_jobRequirement.go │ │ ├── update_offer.go │ │ ├── update_offerCustomField.go │ │ ├── update_talentExternalInfo.go │ │ ├── update_tripartiteAgreement.go │ │ ├── update_websiteChannel.go │ │ └── withdraw_referralAccount.go │ ├── hirev2 │ │ ├── get_interviewRecord.go │ │ ├── get_talent.go │ │ └── list_interviewRecord.go │ ├── human_authenticationv1 │ │ └── create_identity.go │ ├── imv1 │ │ ├── addManagers_chatManagers.go │ │ ├── create_chat.go │ │ ├── create_chatMembers.go │ │ ├── create_chatMenuTree.go │ │ ├── create_chatTab.go │ │ ├── create_file.go │ │ ├── create_image.go │ │ ├── create_message.go │ │ ├── create_messageReaction.go │ │ ├── create_pin.go │ │ ├── deleteManagers_chatManagers.go │ │ ├── deleteTabs_chatTab.go │ │ ├── deleteTopNotice_chatTopNotice.go │ │ ├── delete_batchMessage.go │ │ ├── delete_chat.go │ │ ├── delete_chatMembers.go │ │ ├── delete_chatMenuTree.go │ │ ├── delete_message.go │ │ ├── delete_messageReaction.go │ │ ├── delete_pin.go │ │ ├── forward_message.go │ │ ├── forward_thread.go │ │ ├── getProgress_batchMessage.go │ │ ├── get_chat.go │ │ ├── get_chatAnnouncement.go │ │ ├── get_chatMembers.go │ │ ├── get_chatMenuTree.go │ │ ├── get_chatModeration.go │ │ ├── get_file.go │ │ ├── get_image.go │ │ ├── get_message.go │ │ ├── get_messageResource.go │ │ ├── isInChat_chatMembers.go │ │ ├── link_chat.go │ │ ├── listTabs_chatTab.go │ │ ├── list_chat.go │ │ ├── list_message.go │ │ ├── list_messageReaction.go │ │ ├── list_pin.go │ │ ├── meJoin_chatMembers.go │ │ ├── mergeForward_message.go │ │ ├── patch_chatAnnouncement.go │ │ ├── patch_chatMenuItem.go │ │ ├── patch_message.go │ │ ├── pushFollowUp_message.go │ │ ├── putTopNotice_chatTopNotice.go │ │ ├── readUser_batchMessage.go │ │ ├── readUsers_message.go │ │ ├── reply_message.go │ │ ├── search_chat.go │ │ ├── sortTabs_chatTab.go │ │ ├── sort_chatMenuTree.go │ │ ├── updateTabs_chatTab.go │ │ ├── update_chat.go │ │ ├── update_chatModeration.go │ │ ├── update_message.go │ │ ├── urgentApp_message.go │ │ ├── urgentPhone_message.go │ │ └── urgentSms_message.go │ ├── imv2 │ │ ├── batchUpdate_urlPreview.go │ │ ├── botTimeSentive_feedCard.go │ │ ├── create_appFeedCard.go │ │ ├── create_bizEntityTagRelation.go │ │ ├── create_tag.go │ │ ├── delete_appFeedCardBatch.go │ │ ├── get_bizEntityTagRelation.go │ │ ├── patch_feedCard.go │ │ ├── patch_tag.go │ │ ├── update_appFeedCardBatch.go │ │ ├── update_bizEntityTagRelation.go │ │ └── update_chatButton.go │ ├── lingov1 │ │ ├── create_draft.go │ │ ├── create_entity.go │ │ ├── delete_entity.go │ │ ├── download_file.go │ │ ├── get_entity.go │ │ ├── highlight_entity.go │ │ ├── list_classification.go │ │ ├── list_entity.go │ │ ├── list_repo.go │ │ ├── match_entity.go │ │ ├── search_entity.go │ │ ├── update_draft.go │ │ ├── update_entity.go │ │ └── upload_file.go │ ├── mailv1 │ │ ├── batchCreate_mailgroupManager.go │ │ ├── batchCreate_mailgroupMember.go │ │ ├── batchCreate_mailgroupPermissionMember.go │ │ ├── batchCreate_publicMailboxMember.go │ │ ├── batchDelete_mailgroupManager.go │ │ ├── batchDelete_mailgroupMember.go │ │ ├── batchDelete_mailgroupPermissionMember.go │ │ ├── batchDelete_publicMailboxMember.go │ │ ├── clear_publicMailboxMember.go │ │ ├── create_mailgroup.go │ │ ├── create_mailgroupAlias.go │ │ ├── create_mailgroupMember.go │ │ ├── create_mailgroupPermissionMember.go │ │ ├── create_publicMailbox.go │ │ ├── create_publicMailboxAlias.go │ │ ├── create_publicMailboxMember.go │ │ ├── create_userMailboxAlias.go │ │ ├── create_userMailboxFolder.go │ │ ├── create_userMailboxMailContact.go │ │ ├── create_userMailboxRule.go │ │ ├── delete_mailgroup.go │ │ ├── delete_mailgroupAlias.go │ │ ├── delete_mailgroupMember.go │ │ ├── delete_mailgroupPermissionMember.go │ │ ├── delete_publicMailbox.go │ │ ├── delete_publicMailboxAlias.go │ │ ├── delete_publicMailboxMember.go │ │ ├── delete_userMailbox.go │ │ ├── delete_userMailboxAlias.go │ │ ├── delete_userMailboxFolder.go │ │ ├── delete_userMailboxMailContact.go │ │ ├── delete_userMailboxRule.go │ │ ├── downloadUrl_userMailboxMessageAttachment.go │ │ ├── getByCard_userMailboxMessage.go │ │ ├── get_mailgroup.go │ │ ├── get_mailgroupMember.go │ │ ├── get_mailgroupPermissionMember.go │ │ ├── get_publicMailbox.go │ │ ├── get_publicMailboxMember.go │ │ ├── get_userMailboxMessage.go │ │ ├── list_mailgroup.go │ │ ├── list_mailgroupAlias.go │ │ ├── list_mailgroupManager.go │ │ ├── list_mailgroupMember.go │ │ ├── list_mailgroupPermissionMember.go │ │ ├── list_publicMailbox.go │ │ ├── list_publicMailboxAlias.go │ │ ├── list_publicMailboxMember.go │ │ ├── list_userMailboxAlias.go │ │ ├── list_userMailboxFolder.go │ │ ├── list_userMailboxMailContact.go │ │ ├── list_userMailboxMessage.go │ │ ├── list_userMailboxRule.go │ │ ├── patch_mailgroup.go │ │ ├── patch_publicMailbox.go │ │ ├── patch_userMailboxFolder.go │ │ ├── patch_userMailboxMailContact.go │ │ ├── query_user.go │ │ ├── removeToRecycleBin_publicMailbox.go │ │ ├── reorder_userMailboxRule.go │ │ ├── send_userMailboxMessage.go │ │ ├── subscribe_userMailboxEvent.go │ │ ├── subscription_userMailboxEvent.go │ │ ├── unsubscribe_userMailboxEvent.go │ │ ├── update_mailgroup.go │ │ ├── update_publicMailbox.go │ │ └── update_userMailboxRule.go │ ├── mdmv1 │ │ ├── bind_userAuthDataRelation.go │ │ └── unbind_userAuthDataRelation.go │ ├── mdmv3 │ │ ├── get_batchCountryRegion.go │ │ └── list_countryRegion.go │ ├── minutesv1 │ │ ├── get_minute.go │ │ ├── get_minuteMedia.go │ │ ├── get_minuteStatistics.go │ │ └── get_minuteTranscript.go │ ├── momentsv1 │ │ └── get_post.go │ ├── okrv1 │ │ ├── batchGet_okr.go │ │ ├── create_period.go │ │ ├── create_progressRecord.go │ │ ├── delete_progressRecord.go │ │ ├── get_progressRecord.go │ │ ├── list_period.go │ │ ├── list_periodRule.go │ │ ├── list_userOkr.go │ │ ├── patch_period.go │ │ ├── query_review.go │ │ ├── update_progressRecord.go │ │ └── upload_image.go │ ├── optical_char_recognitionv1 │ │ └── basicRecognize_image.go │ ├── passportv1 │ │ ├── logout_session.go │ │ └── query_session.go │ ├── payrollv1 │ │ ├── archive_paymentActivity.go │ │ ├── list_acctItem.go │ │ ├── list_costAllocationPlan.go │ │ ├── list_costAllocationReport.go │ │ ├── list_datasource.go │ │ ├── list_paygroup.go │ │ ├── list_paymentActivity.go │ │ ├── list_paymentActivityDetail.go │ │ ├── query_datasourceRecord.go │ │ ├── query_paymentDetail.go │ │ └── save_datasourceRecord.go │ ├── performancev2 │ │ ├── delete_additionalInformationsBatch.go │ │ ├── import_additionalInformation.go │ │ ├── import_metricDetail.go │ │ ├── list_metricTag.go │ │ ├── query_activity.go │ │ ├── query_additionalInformation.go │ │ ├── query_indicator.go │ │ ├── query_metricDetail.go │ │ ├── query_metricField.go │ │ ├── query_metricLib.go │ │ ├── query_metricTemplate.go │ │ ├── query_question.go │ │ ├── query_reviewData.go │ │ ├── query_reviewTemplate.go │ │ ├── query_reviewee.go │ │ └── write_userGroupUserRel.go │ ├── personal_settingsv1 │ │ ├── batchClose_systemStatus.go │ │ ├── batchOpen_systemStatus.go │ │ ├── create_systemStatus.go │ │ ├── delete_systemStatus.go │ │ ├── list_systemStatus.go │ │ └── patch_systemStatus.go │ ├── reportv1 │ │ ├── query_rule.go │ │ ├── query_task.go │ │ └── remove_ruleView.go │ ├── searchv2 │ │ ├── create_app.go │ │ ├── create_dataSource.go │ │ ├── create_dataSourceItem.go │ │ ├── create_message.go │ │ ├── create_schema.go │ │ ├── delete_dataSource.go │ │ ├── delete_dataSourceItem.go │ │ ├── delete_schema.go │ │ ├── get_dataSource.go │ │ ├── get_dataSourceItem.go │ │ ├── get_schema.go │ │ ├── list_dataSource.go │ │ ├── patch_dataSource.go │ │ └── patch_schema.go │ ├── security_and_compliancev1 │ │ └── listData_openapiLog.go │ ├── sheetsv3 │ │ ├── create_spreadsheet.go │ │ ├── create_spreadsheetSheetFilter.go │ │ ├── create_spreadsheetSheetFilterView.go │ │ ├── create_spreadsheetSheetFilterViewCondition.go │ │ ├── create_spreadsheetSheetFloatImage.go │ │ ├── delete_spreadsheetSheetFilter.go │ │ ├── delete_spreadsheetSheetFilterView.go │ │ ├── delete_spreadsheetSheetFilterViewCondition.go │ │ ├── delete_spreadsheetSheetFloatImage.go │ │ ├── find_spreadsheetSheet.go │ │ ├── get_spreadsheet.go │ │ ├── get_spreadsheetSheet.go │ │ ├── get_spreadsheetSheetFilter.go │ │ ├── get_spreadsheetSheetFilterView.go │ │ ├── get_spreadsheetSheetFilterViewCondition.go │ │ ├── get_spreadsheetSheetFloatImage.go │ │ ├── moveDimension_spreadsheetSheet.go │ │ ├── patch_spreadsheet.go │ │ ├── patch_spreadsheetSheetFilterView.go │ │ ├── patch_spreadsheetSheetFloatImage.go │ │ ├── query_spreadsheetSheet.go │ │ ├── query_spreadsheetSheetFilterView.go │ │ ├── query_spreadsheetSheetFilterViewCondition.go │ │ ├── query_spreadsheetSheetFloatImage.go │ │ ├── replace_spreadsheetSheet.go │ │ ├── update_spreadsheetSheetFilter.go │ │ └── update_spreadsheetSheetFilterViewCondition.go │ ├── speech_to_textv1 │ │ ├── fileRecognize_speech.go │ │ └── streamRecognize_speech.go │ ├── taskv1 │ │ ├── batchDeleteCollaborator_task.go │ │ ├── batchDeleteFollower_task.go │ │ ├── complete_task.go │ │ ├── create_task.go │ │ ├── create_taskCollaborator.go │ │ ├── create_taskComment.go │ │ ├── create_taskFollower.go │ │ ├── create_taskReminder.go │ │ ├── delete_task.go │ │ ├── delete_taskCollaborator.go │ │ ├── delete_taskComment.go │ │ ├── delete_taskFollower.go │ │ ├── delete_taskReminder.go │ │ ├── get_task.go │ │ ├── get_taskComment.go │ │ ├── list_task.go │ │ ├── list_taskCollaborator.go │ │ ├── list_taskComment.go │ │ ├── list_taskFollower.go │ │ ├── list_taskReminder.go │ │ ├── patch_task.go │ │ ├── uncomplete_task.go │ │ └── update_taskComment.go │ ├── taskv2 │ │ ├── addDependencies_task.go │ │ ├── addMembers_task.go │ │ ├── addMembers_tasklist.go │ │ ├── addReminders_task.go │ │ ├── addTasklist_task.go │ │ ├── add_customField.go │ │ ├── create_comment.go │ │ ├── create_customField.go │ │ ├── create_customFieldOption.go │ │ ├── create_section.go │ │ ├── create_task.go │ │ ├── create_taskSubtask.go │ │ ├── create_tasklist.go │ │ ├── create_tasklistActivitySubscription.go │ │ ├── delete_attachment.go │ │ ├── delete_comment.go │ │ ├── delete_section.go │ │ ├── delete_task.go │ │ ├── delete_tasklist.go │ │ ├── delete_tasklistActivitySubscription.go │ │ ├── get_attachment.go │ │ ├── get_comment.go │ │ ├── get_customField.go │ │ ├── get_section.go │ │ ├── get_task.go │ │ ├── get_tasklist.go │ │ ├── get_tasklistActivitySubscription.go │ │ ├── list_attachment.go │ │ ├── list_comment.go │ │ ├── list_customField.go │ │ ├── list_section.go │ │ ├── list_task.go │ │ ├── list_taskSubtask.go │ │ ├── list_tasklist.go │ │ ├── list_tasklistActivitySubscription.go │ │ ├── patch_comment.go │ │ ├── patch_customField.go │ │ ├── patch_customFieldOption.go │ │ ├── patch_section.go │ │ ├── patch_task.go │ │ ├── patch_tasklist.go │ │ ├── patch_tasklistActivitySubscription.go │ │ ├── removeDependencies_task.go │ │ ├── removeMembers_task.go │ │ ├── removeMembers_tasklist.go │ │ ├── removeReminders_task.go │ │ ├── removeTasklist_task.go │ │ ├── remove_customField.go │ │ ├── tasklists_task.go │ │ ├── tasks_section.go │ │ ├── tasks_tasklist.go │ │ └── upload_attachment.go │ ├── tenantv2 │ │ ├── query_tenant.go │ │ └── query_tenantProductAssignInfo.go │ ├── translationv1 │ │ ├── detect_text.go │ │ └── translate_text.go │ ├── vcv1 │ │ ├── apply_reserve.go │ │ ├── create_room.go │ │ ├── create_roomLevel.go │ │ ├── create_scopeConfig.go │ │ ├── del_roomLevel.go │ │ ├── delete_reserve.go │ │ ├── delete_room.go │ │ ├── download_export.go │ │ ├── end_meeting.go │ │ ├── getActiveMeeting_reserve.go │ │ ├── getDaily_report.go │ │ ├── getTopUser_report.go │ │ ├── get_export.go │ │ ├── get_meeting.go │ │ ├── get_meetingList.go │ │ ├── get_meetingRecording.go │ │ ├── get_participantList.go │ │ ├── get_participantQualityList.go │ │ ├── get_reserve.go │ │ ├── get_reserveConfigAdmin.go │ │ ├── get_reserveConfigDisableInform.go │ │ ├── get_reserveConfigForm.go │ │ ├── get_resourceReservationList.go │ │ ├── get_room.go │ │ ├── get_roomLevel.go │ │ ├── get_scopeConfig.go │ │ ├── invite_meeting.go │ │ ├── kickout_meeting.go │ │ ├── listByNo_meeting.go │ │ ├── list_alert.go │ │ ├── list_room.go │ │ ├── list_roomLevel.go │ │ ├── meetingList_export.go │ │ ├── mget_room.go │ │ ├── mget_roomLevel.go │ │ ├── participantList_export.go │ │ ├── participantQualityList_export.go │ │ ├── patch_reserveConfig.go │ │ ├── patch_reserveConfigAdmin.go │ │ ├── patch_reserveConfigDisableInform.go │ │ ├── patch_reserveConfigForm.go │ │ ├── patch_room.go │ │ ├── patch_roomLevel.go │ │ ├── query_roomConfig.go │ │ ├── reserveScope_reserveConfig.go │ │ ├── resourceReservationList_export.go │ │ ├── search_room.go │ │ ├── search_roomLevel.go │ │ ├── setCheckboardAccessCode_roomConfig.go │ │ ├── setHost_meeting.go │ │ ├── setPermission_meetingRecording.go │ │ ├── setRoomAccessCode_roomConfig.go │ │ ├── set_roomConfig.go │ │ ├── start_meetingRecording.go │ │ ├── stop_meetingRecording.go │ │ └── update_reserve.go │ ├── verificationv1 │ │ └── get_verification.go │ ├── wikiv2 │ │ ├── copy_spaceNode.go │ │ ├── create_space.go │ │ ├── create_spaceMember.go │ │ ├── create_spaceNode.go │ │ ├── delete_spaceMember.go │ │ ├── getNode_space.go │ │ ├── get_space.go │ │ ├── get_task.go │ │ ├── list_space.go │ │ ├── list_spaceMember.go │ │ ├── list_spaceNode.go │ │ ├── moveDocsToWiki_spaceNode.go │ │ ├── move_spaceNode.go │ │ ├── updateTitle_spaceNode.go │ │ └── update_spaceSetting.go │ └── workplacev1 │ │ ├── search_customWorkplaceAccessData.go │ │ ├── search_workplaceAccessData.go │ │ └── search_workplaceBlockAccessData.go ├── callrawapi │ └── api.go ├── card │ └── card.go ├── client │ └── main.go ├── event │ └── event.go ├── go.mod ├── go.sum ├── mocksendcardaction │ └── main.go ├── mocksendevent │ └── main.go └── ws │ └── sample.go ├── sensitive_info_result.txt ├── service ├── acs │ ├── service.go │ └── v1 │ │ ├── event.go │ │ ├── model.go │ │ └── resource.go ├── admin │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── aily │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── apaas │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── application │ ├── service.go │ └── v6 │ │ ├── event.go │ │ ├── ext_event.go │ │ ├── ext_model.go │ │ ├── model.go │ │ └── resource.go ├── approval │ ├── service.go │ └── v4 │ │ ├── event.go │ │ ├── ext_event.go │ │ ├── ext_model.go │ │ ├── model.go │ │ └── resource.go ├── attendance │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── auth │ ├── service.go │ └── v3 │ │ ├── model.go │ │ └── resource.go ├── authen │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── baike │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── base │ ├── service.go │ └── v2 │ │ ├── model.go │ │ └── resource.go ├── bitable │ ├── service.go │ └── v1 │ │ ├── model.go │ │ ├── model_ext.go │ │ └── resource.go ├── block │ ├── service.go │ └── v2 │ │ ├── model.go │ │ └── resource.go ├── board │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── calendar │ ├── service.go │ └── v4 │ │ ├── event.go │ │ ├── model.go │ │ └── resource.go ├── cardkit │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── compensation │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── contact │ ├── service.go │ └── v3 │ │ ├── event.go │ │ ├── ext_event.go │ │ ├── ext_model.go │ │ ├── model.go │ │ └── resource.go ├── corehr │ ├── service.go │ ├── v1 │ │ ├── event.go │ │ ├── model.go │ │ └── resource.go │ └── v2 │ │ ├── event.go │ │ ├── model.go │ │ └── resource.go ├── docs │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── document_ai │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── docx │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── drive │ ├── service.go │ ├── v1 │ │ ├── api_ext.go │ │ ├── event.go │ │ ├── model.go │ │ └── resource.go │ └── v2 │ │ ├── model.go │ │ └── resource.go ├── ehr │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── event │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── ext │ ├── api.go │ └── model.go ├── face_detection │ └── v1 │ │ ├── api.go │ │ └── model.go ├── helpdesk │ ├── service.go │ └── v1 │ │ ├── event.go │ │ ├── model.go │ │ └── resource.go ├── hire │ ├── service.go │ ├── v1 │ │ ├── event.go │ │ ├── model.go │ │ └── resource.go │ └── v2 │ │ ├── model.go │ │ └── resource.go ├── human_authentication │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── im │ ├── service.go │ ├── v1 │ │ ├── event.go │ │ ├── ext_event.go │ │ ├── ext_model.go │ │ ├── model.go │ │ └── resource.go │ └── v2 │ │ ├── model.go │ │ └── resource.go ├── lingo │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── mail │ ├── service.go │ └── v1 │ │ ├── event.go │ │ ├── model.go │ │ └── resource.go ├── mdm │ ├── service.go │ ├── v1 │ │ ├── model.go │ │ └── resource.go │ └── v3 │ │ ├── model.go │ │ └── resource.go ├── meeting_room │ ├── service.go │ └── v1 │ │ ├── event.go │ │ ├── ext_event.go │ │ ├── ext_model.go │ │ ├── model.go │ │ └── resource.go ├── minutes │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── moments │ ├── service.go │ └── v1 │ │ ├── event.go │ │ ├── model.go │ │ └── resource.go ├── okr │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── optical_char_recognition │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── passport │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── payroll │ ├── service.go │ └── v1 │ │ ├── event.go │ │ ├── model.go │ │ └── resource.go ├── performance │ ├── service.go │ └── v2 │ │ ├── event.go │ │ ├── model.go │ │ └── resource.go ├── personal_settings │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── report │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── search │ ├── service.go │ └── v2 │ │ ├── model.go │ │ └── resource.go ├── security_and_compliance │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── sheets │ ├── service.go │ └── v3 │ │ ├── model.go │ │ └── resource.go ├── speech_to_text │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── task │ ├── service.go │ ├── v1 │ │ ├── event.go │ │ ├── model.go │ │ └── resource.go │ └── v2 │ │ ├── model.go │ │ └── resource.go ├── tenant │ ├── service.go │ └── v2 │ │ ├── model.go │ │ └── resource.go ├── translation │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── vc │ ├── service.go │ └── v1 │ │ ├── event.go │ │ ├── model.go │ │ └── resource.go ├── verification │ ├── service.go │ └── v1 │ │ ├── model.go │ │ └── resource.go ├── wiki │ ├── service.go │ └── v2 │ │ ├── model.go │ │ └── resource.go └── workplace │ ├── service.go │ └── v1 │ ├── model.go │ └── resource.go └── ws ├── client.go ├── const.go ├── error.go ├── model.go └── pbbp2.pb.go /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | name: Go 2 | 3 | on: 4 | push: 5 | branches: [ v2_rewrite ] 6 | pull_request: 7 | branches: [ v2_rewrite ] 8 | 9 | jobs: 10 | 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Set up Go 17 | uses: actions/setup-go@v2 18 | with: 19 | go-version: 1.12 20 | 21 | - name: GolangCI-Linter 22 | uses: Mushus/golangci-linter@v1.1.2 23 | with: 24 | basePath: ./v2 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | output 2 | *.pyc 3 | *.sw? 4 | .idea 5 | .vscode 6 | .DS_Store 7 | coverage 8 | modules.txt 9 | *.log 10 | *.json 11 | *.sh 12 | test.go 13 | sensitive_info_result.txt 14 | .env -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Lark Technologies Pte. Ltd. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /cache/cache.go: -------------------------------------------------------------------------------- 1 | package larkcache 2 | 3 | import ( 4 | "runtime" 5 | "sync" 6 | "time" 7 | ) 8 | 9 | func New(clearInterval time.Duration) *Cache { 10 | cache := &Cache{} 11 | cache.cron = newCron(cache.clear, clearInterval) 12 | runtime.SetFinalizer(cache, stopCron) 13 | 14 | return cache 15 | } 16 | 17 | type Cache struct { 18 | m sync.Map 19 | cron *cron 20 | } 21 | 22 | type elem struct { 23 | val interface{} 24 | expire time.Time 25 | } 26 | 27 | type cron struct { 28 | cmd func() 29 | interval time.Duration 30 | stop chan bool 31 | } 32 | 33 | func (c *cron) start() { 34 | ticker := time.NewTicker(c.interval) 35 | for { 36 | select { 37 | case <-ticker.C: 38 | c.cmd() 39 | case <-c.stop: 40 | ticker.Stop() 41 | return 42 | } 43 | } 44 | } 45 | 46 | func newCron(cmd func(), interval time.Duration) *cron { 47 | cron := &cron{ 48 | cmd: cmd, 49 | interval: interval, 50 | stop: make(chan bool), 51 | } 52 | 53 | go cron.start() 54 | 55 | return cron 56 | } 57 | 58 | func stopCron(c *Cache) { 59 | c.cron.stop <- true 60 | } 61 | 62 | func (c *Cache) Get(key string) interface{} { 63 | if val, ok := c.m.Load(key); ok { 64 | elem := val.(*elem) 65 | if elem.expire.After(time.Now()) { 66 | return elem.val 67 | } 68 | } 69 | return nil 70 | } 71 | 72 | func (c *Cache) Set(key string, value interface{}, expire time.Duration) { 73 | expireTime := time.Now().Add(expire) 74 | c.m.Store(key, &elem{ 75 | val: value, 76 | expire: expireTime, 77 | }) 78 | } 79 | 80 | func (c *Cache) clear() { 81 | c.m.Range(func(k, v interface{}) bool { 82 | elem := v.(*elem) 83 | if elem.expire.Before(time.Now()) { 84 | c.m.Delete(k) 85 | } 86 | return true 87 | }) 88 | } 89 | -------------------------------------------------------------------------------- /cache/cache_test.go: -------------------------------------------------------------------------------- 1 | package larkcache 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | "time" 7 | ) 8 | 9 | func TestNew(t *testing.T) { 10 | cache := New(1 * time.Second) 11 | cache.Set("a", "a", 3*time.Second) 12 | time.Sleep(5 * time.Second) 13 | val := cache.Get("a") 14 | fmt.Println(val) 15 | } 16 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | ## v3.0.11 6 | 7 | Added 8 | 9 | - 事件服务器添加跳过验签的选项 10 | 11 | ## v3.0.10 12 | 13 | Added 14 | 15 | - 更新业务功能 16 | 17 | ## v3.0.9 18 | 19 | Added 20 | 21 | - 更新业务功能 22 | 23 | ## v3.0.8 24 | 25 | Added 26 | 27 | - 更新业务功能 28 | 29 | ## v3.0.5 30 | 31 | Added 32 | 33 | - 更新业务功能,比如docx评论相关api 34 | 35 | ## v3.0.4 36 | 37 | Added 38 | 39 | - 添加调用示例 40 | 41 | ## v3.0.3 42 | 43 | Added 44 | 45 | - 初始化client时,提供withHeaders选项,让开发者设置一些在所有请求都是用的header,比如环境标 46 | 47 | ## v3.0.2 48 | 49 | Fixed 50 | 51 | - 修改枚举值名称为:methodName+resourceName+enumValue 52 | 53 | ## v3.0.1 54 | 55 | Added 56 | 57 | - API方法,消息事件,各种结构体添加文字描述注释 58 | 59 | ## v3.0.0-beta-7-2022-08-12 60 | 61 | Added 62 | 63 | - 消息卡片添加MessageCardEmbedImage结构体 64 | 65 | ## v3.0.0-beta-6-2022-08-05 66 | 67 | Added 68 | 69 | - 添加 API 调用时,让开发者传递 appTicket,SDK内部根据appticket自动获取token的功能 70 | - 添加获取登录用户身份、刷新 access_token,获取用户信息(身份验证)的接口 71 | 72 | ## v3.0.0-beta-5-2022-08-01 73 | 74 | Added 75 | 76 | - 添加 多维表格结果解析器 77 | 78 | ## v3.0.0-beta-4-2022-07-27 79 | 80 | Added 81 | 82 | - 添加所有 API 的使用 Demo 83 | 84 | ## v3.0.0-beta-3-2022-07-10 85 | 86 | Fixed 87 | 88 | - 对path参数进行encode 89 | 90 | ## v3.0.0-beta-2-2022-06-30 91 | 92 | Added 93 | 94 | - 添加所有 V1.0 协议的消息处理器 95 | 96 | ## v3.0.0-beta-1-2022-06-15 97 | 98 | Added 99 | 100 | - 添加 v3 的代码 -------------------------------------------------------------------------------- /core/config.go: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | * 8 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | */ 12 | 13 | package larkcore 14 | 15 | import ( 16 | "net/http" 17 | "time" 18 | ) 19 | 20 | type Config struct { 21 | BaseUrl string 22 | AppId string 23 | AppSecret string 24 | HelpDeskId string 25 | HelpDeskToken string 26 | HelpdeskAuthToken string 27 | ReqTimeout time.Duration 28 | LogLevel LogLevel 29 | HttpClient HttpClient 30 | Logger Logger 31 | AppType AppType 32 | EnableTokenCache bool 33 | TokenCache Cache 34 | LogReqAtDebug bool 35 | Header http.Header 36 | Serializable Serializable 37 | SkipSignVerify bool 38 | } 39 | -------------------------------------------------------------------------------- /core/errors.go: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | * 8 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | */ 12 | 13 | package larkcore 14 | 15 | type IllegalParamError struct { 16 | msg string 17 | } 18 | 19 | func (err *IllegalParamError) Error() string { 20 | return err.msg 21 | } 22 | 23 | type ClientTimeoutError struct { 24 | msg string 25 | } 26 | 27 | func (err *ClientTimeoutError) Error() string { 28 | return err.msg 29 | } 30 | 31 | type ServerTimeoutError struct { 32 | msg string 33 | } 34 | 35 | func (err *ServerTimeoutError) Error() string { 36 | return err.msg 37 | } 38 | 39 | type DialFailedError struct { 40 | msg string 41 | } 42 | 43 | func (err *DialFailedError) Error() string { 44 | return err.msg 45 | } 46 | -------------------------------------------------------------------------------- /core/httpclient.go: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | * 8 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | */ 12 | 13 | package larkcore 14 | 15 | import ( 16 | "net/http" 17 | ) 18 | 19 | // HttpClient :sdk-core面向HttpClient接口编程,实现core与httpclient解耦 20 | // 1.可以适配所有基于go-sdk内置httpclient构建的三方httpclient 21 | // 2.可以方便的对httpclient进行mock, 方便编写单元测试 22 | type HttpClient interface { 23 | Do(*http.Request) (*http.Response, error) 24 | } 25 | -------------------------------------------------------------------------------- /core/httpclient_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | * 8 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | */ 12 | 13 | package larkcore 14 | 15 | import ( 16 | "fmt" 17 | "net/http" 18 | "testing" 19 | ) 20 | 21 | type CustomHttpClient struct { 22 | } 23 | 24 | func (client *CustomHttpClient) Do(*http.Request) (*http.Response, error) { 25 | return nil, nil 26 | } 27 | 28 | func TestHttpClient(t *testing.T) { 29 | 30 | httpClient := &CustomHttpClient{} 31 | 32 | req, _ := http.NewRequest("GET", "http://www.baidu.com", nil) 33 | resp, err := httpClient.Do(req) 34 | if err != nil { 35 | t.Errorf("TestHttpClient failed ,%v", err) 36 | } 37 | 38 | fmt.Println(resp) 39 | 40 | } 41 | -------------------------------------------------------------------------------- /core/httptransport_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | * 8 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | */ 12 | 13 | package larkcore 14 | 15 | import ( 16 | "context" 17 | "fmt" 18 | "net/http" 19 | "testing" 20 | ) 21 | 22 | func TestSendPost(t *testing.T) { 23 | config := mockConfig() 24 | _, err := Request(context.Background(), &ApiReq{ 25 | HttpMethod: http.MethodPost, 26 | ApiPath: "/", 27 | Body: map[string]interface{}{ 28 | "approval_code": "ou_c245b0a7dff2725cfa2fb104f8b48b9d", 29 | }, 30 | SupportedAccessTokenTypes: []AccessTokenType{AccessTokenTypeUser}, 31 | }, config, WithUserAccessToken("key")) 32 | 33 | if err != nil { 34 | t.Errorf("TestSendPost failed ,%v", err) 35 | return 36 | } 37 | fmt.Println("ok") 38 | 39 | } 40 | -------------------------------------------------------------------------------- /core/serialization.go: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | * 8 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | */ 12 | 13 | package larkcore 14 | 15 | import "encoding/json" 16 | 17 | type Serializable interface { 18 | Serialize(v interface{}) ([]byte, error) 19 | Deserialize(data []byte, v interface{}) error 20 | } 21 | 22 | type DefaultSerialization struct { 23 | } 24 | 25 | func (d *DefaultSerialization) Serialize(v interface{}) ([]byte, error) { 26 | return json.Marshal(v) 27 | } 28 | func (d *DefaultSerialization) Deserialize(data []byte, v interface{}) error { 29 | return json.Unmarshal(data, v) 30 | } 31 | -------------------------------------------------------------------------------- /core/tokenmanager_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | * 8 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | */ 12 | 13 | package larkcore 14 | 15 | import ( 16 | "context" 17 | "testing" 18 | "time" 19 | ) 20 | 21 | func TestTokenManagerSetAndGet(t *testing.T) { 22 | config := mockConfig() 23 | cache := &localCache{} 24 | tokenManager := TokenManager{cache: cache} 25 | 26 | err := tokenManager.set(context.Background(), tenantAccessTokenKey(config.AppId, "tenantKey"), "tokenValue", time.Minute) 27 | if err != nil { 28 | t.Errorf("set key failed ,%v", err) 29 | } 30 | 31 | token, err := tokenManager.getTenantAccessToken(context.Background(), config, "tenantKey", "") 32 | if err != nil { 33 | t.Errorf("get key failed ,%v", err) 34 | } 35 | 36 | if token == "" { 37 | t.Errorf("get key failed ,%v", err) 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /core/utils_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | * 8 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | */ 12 | 13 | package larkcore 14 | 15 | import ( 16 | "context" 17 | "testing" 18 | ) 19 | 20 | func TestEncryptedEventMsg(t *testing.T) { 21 | en, err := EncryptedEventMsg(context.Background(), map[string]string{"key1": "value1", "key2": "value2"}, "encrypteKey") 22 | if err != nil { 23 | t.Errorf("TestEncryptedEventMsg failed ,%v", err) 24 | } 25 | 26 | if en == "" { 27 | t.Errorf("TestEncryptedEventMsg failed ,%v", err) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /core/version.go: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | * 8 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | */ 12 | 13 | package larkcore 14 | 15 | const version = "v3.0.0" 16 | -------------------------------------------------------------------------------- /doc/console.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larksuite/oapi-sdk-go/08f7064c2ddf975658d43808662d9530d5f7ffa4/doc/console.jpeg -------------------------------------------------------------------------------- /doc/event_protocol.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larksuite/oapi-sdk-go/08f7064c2ddf975658d43808662d9530d5f7ffa4/doc/event_protocol.jpeg -------------------------------------------------------------------------------- /doc/find_method.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larksuite/oapi-sdk-go/08f7064c2ddf975658d43808662d9530d5f7ffa4/doc/find_method.jpg -------------------------------------------------------------------------------- /event/dispatcher/approval_v4_event_dispatch.go: -------------------------------------------------------------------------------- 1 | // Package dispatcher code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package dispatcher 15 | 16 | import ( 17 | "context" 18 | "github.com/larksuite/oapi-sdk-go/v3/service/approval/v4" 19 | ) 20 | // 21 | // 22 | // - 23 | // 24 | // - 事件描述文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uIDO24iM4YjLygjN/event/custom-approval-event 25 | func ( dispatcher * EventDispatcher ) OnP2ApprovalUpdatedV4(handler func(ctx context.Context, event *larkapproval.P2ApprovalUpdatedV4) error) * EventDispatcher{ 26 | _, existed := dispatcher.eventType2EventHandler["approval.approval.updated_v4"] 27 | if existed { 28 | panic("event: multiple handler registrations for " + "approval.approval.updated_v4") 29 | } 30 | dispatcher.eventType2EventHandler["approval.approval.updated_v4"] = larkapproval.NewP2ApprovalUpdatedV4Handler(handler) 31 | return dispatcher 32 | } -------------------------------------------------------------------------------- /event/dispatcher/callback/event.go: -------------------------------------------------------------------------------- 1 | package callback 2 | 3 | import "context" 4 | 5 | // 消息处理器定义 6 | type CardActionTriggerEventHandler struct { 7 | handler func(context.Context, *CardActionTriggerEvent) (*CardActionTriggerResponse, error) 8 | } 9 | 10 | func NewCardActionTriggerEventHandler(handler func(context.Context, *CardActionTriggerEvent) (*CardActionTriggerResponse, error)) *CardActionTriggerEventHandler { 11 | h := &CardActionTriggerEventHandler{handler: handler} 12 | return h 13 | } 14 | 15 | // 返回事件的消息体的实例,用于反序列化用 16 | func (h *CardActionTriggerEventHandler) Event() interface{} { 17 | return &CardActionTriggerEvent{} 18 | } 19 | 20 | // 回调开发者注册的handle 21 | func (h *CardActionTriggerEventHandler) Handle(ctx context.Context, event interface{}) (interface{}, error) { 22 | return h.handler(ctx, event.(*CardActionTriggerEvent)) 23 | } 24 | 25 | // 消息处理器定义 26 | type URLPreviewGetEventHandler struct { 27 | handler func(context.Context, *URLPreviewGetEvent) (*URLPreviewGetResponse, error) 28 | } 29 | 30 | func NewURLPreviewGetEventHandler(handler func(context.Context, *URLPreviewGetEvent) (*URLPreviewGetResponse, error)) *URLPreviewGetEventHandler { 31 | h := &URLPreviewGetEventHandler{handler: handler} 32 | return h 33 | } 34 | 35 | // 返回事件的消息体的实例,用于反序列化用 36 | func (h *URLPreviewGetEventHandler) Event() interface{} { 37 | return &URLPreviewGetEvent{} 38 | } 39 | 40 | // 回调开发者注册的handle 41 | func (h *URLPreviewGetEventHandler) Handle(ctx context.Context, event interface{}) (interface{}, error) { 42 | return h.handler(ctx, event.(*URLPreviewGetEvent)) 43 | } 44 | -------------------------------------------------------------------------------- /event/dispatcher/callback_dispatch.go: -------------------------------------------------------------------------------- 1 | package dispatcher 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/larksuite/oapi-sdk-go/v3/event/dispatcher/callback" 7 | ) 8 | 9 | func (dispatcher *EventDispatcher) OnP2CardActionTrigger(handler func(ctx context.Context, event *callback.CardActionTriggerEvent) (*callback.CardActionTriggerResponse, error)) *EventDispatcher { 10 | _, existed := dispatcher.callbackType2CallbackHandler["card.action.trigger"] 11 | if existed { 12 | panic("event: multiple handler registrations for " + "card.action.trigger") 13 | } 14 | dispatcher.callbackType2CallbackHandler["card.action.trigger"] = callback.NewCardActionTriggerEventHandler(handler) 15 | return dispatcher 16 | } 17 | 18 | func (dispatcher *EventDispatcher) OnP2CardURLPreviewGet(handler func(ctx context.Context, event *callback.URLPreviewGetEvent) (*callback.URLPreviewGetResponse, error)) *EventDispatcher { 19 | _, existed := dispatcher.callbackType2CallbackHandler["url.preview.get"] 20 | if existed { 21 | panic("event: multiple handler registrations for " + "url.preview.get") 22 | } 23 | dispatcher.callbackType2CallbackHandler["url.preview.get"] = callback.NewURLPreviewGetEventHandler(handler) 24 | return dispatcher 25 | } 26 | -------------------------------------------------------------------------------- /event/dispatcher/custom_appticket_handler.go: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | * 8 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | */ 12 | 13 | package dispatcher 14 | 15 | import ( 16 | "context" 17 | ) 18 | 19 | type CustomAppTicketEventHandler struct { 20 | handler func(context.Context, *AppTicketEvent) error 21 | } 22 | 23 | func (h *CustomAppTicketEventHandler) Event() interface{} { 24 | return &AppTicketEvent{} 25 | } 26 | 27 | func (h *CustomAppTicketEventHandler) Handle(ctx context.Context, event interface{}) error { 28 | return h.handler(ctx, event.(*AppTicketEvent)) 29 | } 30 | -------------------------------------------------------------------------------- /event/dispatcher/mail_v1_event_dispatch.go: -------------------------------------------------------------------------------- 1 | // Package dispatcher code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package dispatcher 15 | 16 | import ( 17 | "context" 18 | "github.com/larksuite/oapi-sdk-go/v3/service/mail/v1" 19 | ) 20 | // 21 | // 22 | // - 23 | // 24 | // - 事件描述文档链接: 25 | func ( dispatcher * EventDispatcher ) OnP2UserMailboxEventMessageReceivedV1(handler func(ctx context.Context, event *larkmail.P2UserMailboxEventMessageReceivedV1) error) * EventDispatcher{ 26 | _, existed := dispatcher.eventType2EventHandler["mail.user_mailbox.event.message_received_v1"] 27 | if existed { 28 | panic("event: multiple handler registrations for " + "mail.user_mailbox.event.message_received_v1") 29 | } 30 | dispatcher.eventType2EventHandler["mail.user_mailbox.event.message_received_v1"] = larkmail.NewP2UserMailboxEventMessageReceivedV1Handler(handler) 31 | return dispatcher 32 | } -------------------------------------------------------------------------------- /sample/api/okr.go: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | * 8 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | */ 12 | 13 | package main 14 | 15 | import ( 16 | "context" 17 | "fmt" 18 | "os" 19 | 20 | lark "github.com/larksuite/oapi-sdk-go/v3" 21 | larkcore "github.com/larksuite/oapi-sdk-go/v3/core" 22 | larkokr "github.com/larksuite/oapi-sdk-go/v3/service/okr/v1" 23 | ) 24 | 25 | func main() { 26 | var appID, appSecret = os.Getenv("APP_ID"), os.Getenv("APP_SECRET") 27 | 28 | feishuClient := lark.NewClient(appID, appSecret, lark.WithLogLevel(larkcore.LogLevelDebug)) 29 | resp, err := feishuClient.Okr.Period.List(context.Background(), larkokr.NewListPeriodReqBuilder(). 30 | PageSize(10). 31 | Build()) 32 | 33 | if err != nil { 34 | fmt.Println(err) 35 | return 36 | } 37 | 38 | if !resp.Success() { 39 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 40 | return 41 | } 42 | 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/acsv1/delete_ruleExternal.go: -------------------------------------------------------------------------------- 1 | // Package acs code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/acs/v1" 22 | ) 23 | 24 | // DELETE /open-apis/acs/v1/rule_external 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkacs.NewDeleteRuleExternalReqBuilder(). 30 | RuleId("7298933941867135276"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Acs.V1.RuleExternal.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/acsv1/list_device.go: -------------------------------------------------------------------------------- 1 | // Package acs code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // GET /open-apis/acs/v1/devices 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Acs.V1.Device.List(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/acsv1/list_user.go: -------------------------------------------------------------------------------- 1 | // Package acs code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/acs/v1" 22 | ) 23 | 24 | // GET /open-apis/acs/v1/users 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkacs.NewListUserReqBuilder(). 30 | PageSize(10). 31 | PageToken("10"). 32 | UserIdType("user_id"). 33 | Build() 34 | // 发起请求 35 | resp, err := client.Acs.V1.User.List(context.Background(), req) 36 | 37 | // 处理错误 38 | if err != nil { 39 | fmt.Println(err) 40 | return 41 | } 42 | 43 | // 服务端错误处理 44 | if !resp.Success() { 45 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 46 | return 47 | } 48 | 49 | // 业务处理 50 | fmt.Println(larkcore.Prettify(resp)) 51 | } 52 | -------------------------------------------------------------------------------- /sample/apiall/adminv1/get_badge.go: -------------------------------------------------------------------------------- 1 | // Package admin code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/admin/v1" 22 | ) 23 | 24 | // GET /open-apis/admin/v1/badges/:badge_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkadmin.NewGetBadgeReqBuilder(). 30 | BadgeId("m_DjMzaK"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Admin.V1.Badge.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/adminv1/list_badge.go: -------------------------------------------------------------------------------- 1 | // Package admin code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/admin/v1" 22 | ) 23 | 24 | // GET /open-apis/admin/v1/badges 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkadmin.NewListBadgeReqBuilder(). 30 | PageSize(10). 31 | PageToken("b1fmUz"). 32 | Name("激励勋章"). 33 | Build() 34 | // 发起请求 35 | resp, err := client.Admin.V1.Badge.List(context.Background(), req) 36 | 37 | // 处理错误 38 | if err != nil { 39 | fmt.Println(err) 40 | return 41 | } 42 | 43 | // 服务端错误处理 44 | if !resp.Success() { 45 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 46 | return 47 | } 48 | 49 | // 业务处理 50 | fmt.Println(larkcore.Prettify(resp)) 51 | } 52 | -------------------------------------------------------------------------------- /sample/apiall/applicationv6/apply_scope.go: -------------------------------------------------------------------------------- 1 | // Package application code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // POST /open-apis/application/v6/scopes/apply 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Application.V6.Scope.Apply(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/applicationv6/list_scope.go: -------------------------------------------------------------------------------- 1 | // Package application code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // GET /open-apis/application/v6/scopes 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Application.V6.Scope.List(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/attendancev1/query_shift.go: -------------------------------------------------------------------------------- 1 | // Package attendance code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/attendance/v1" 22 | ) 23 | 24 | // POST /open-apis/attendance/v1/shifts/query 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkattendance.NewQueryShiftReqBuilder(). 30 | ShiftName("早班"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Attendance.V1.Shift.Query(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/authenv1/get_userInfo.go: -------------------------------------------------------------------------------- 1 | // Package authen code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // GET /open-apis/authen/v1/user_info 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Authen.V1.UserInfo.Get(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/bitablev1/get_app.go: -------------------------------------------------------------------------------- 1 | // Package bitable code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/bitable/v1" 22 | ) 23 | 24 | // GET /open-apis/bitable/v1/apps/:app_token 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkbitable.NewGetAppReqBuilder(). 30 | AppToken("appbcbWCzen6D8dezhoCH2RpMAh"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Bitable.V1.App.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/calendarv4/subscription_calendar.go: -------------------------------------------------------------------------------- 1 | // Package calendar code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // POST /open-apis/calendar/v4/calendars/subscription 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Calendar.V4.Calendar.Subscription(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/calendarv4/unsubscription_calendar.go: -------------------------------------------------------------------------------- 1 | // Package calendar code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // POST /open-apis/calendar/v4/calendars/unsubscription 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Calendar.V4.Calendar.Unsubscription(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/contactv3/delete_group.go: -------------------------------------------------------------------------------- 1 | // Package contact code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/contact/v3" 22 | ) 23 | 24 | // DELETE /open-apis/contact/v3/group/:group_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcontact.NewDeleteGroupReqBuilder(). 30 | GroupId("g1837191"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Contact.V3.Group.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/contactv3/delete_unit.go: -------------------------------------------------------------------------------- 1 | // Package contact code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/contact/v3" 22 | ) 23 | 24 | // DELETE /open-apis/contact/v3/unit/:unit_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcontact.NewDeleteUnitReqBuilder(). 30 | UnitId("BU121"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Contact.V3.Unit.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/contactv3/get_unit.go: -------------------------------------------------------------------------------- 1 | // Package contact code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/contact/v3" 22 | ) 23 | 24 | // GET /open-apis/contact/v3/unit/:unit_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcontact.NewGetUnitReqBuilder(). 30 | UnitId("BU121"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Contact.V3.Unit.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/contactv3/list_jobTitle.go: -------------------------------------------------------------------------------- 1 | // Package contact code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/contact/v3" 22 | ) 23 | 24 | // GET /open-apis/contact/v3/job_titles 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcontact.NewListJobTitleReqBuilder(). 30 | PageSize(10). 31 | PageToken(""). 32 | Build() 33 | // 发起请求 34 | resp, err := client.Contact.V3.JobTitle.List(context.Background(), req) 35 | 36 | // 处理错误 37 | if err != nil { 38 | fmt.Println(err) 39 | return 40 | } 41 | 42 | // 服务端错误处理 43 | if !resp.Success() { 44 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 45 | return 46 | } 47 | 48 | // 业务处理 49 | fmt.Println(larkcore.Prettify(resp)) 50 | } 51 | -------------------------------------------------------------------------------- /sample/apiall/contactv3/list_workCity.go: -------------------------------------------------------------------------------- 1 | // Package contact code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/contact/v3" 22 | ) 23 | 24 | // GET /open-apis/contact/v3/work_cities 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcontact.NewListWorkCityReqBuilder(). 30 | PageSize(10). 31 | PageToken(""). 32 | Build() 33 | // 发起请求 34 | resp, err := client.Contact.V3.WorkCity.List(context.Background(), req) 35 | 36 | // 处理错误 37 | if err != nil { 38 | fmt.Println(err) 39 | return 40 | } 41 | 42 | // 服务端错误处理 43 | if !resp.Success() { 44 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 45 | return 46 | } 47 | 48 | // 业务处理 49 | fmt.Println(larkcore.Prettify(resp)) 50 | } 51 | -------------------------------------------------------------------------------- /sample/apiall/corehrv1/delete_company.go: -------------------------------------------------------------------------------- 1 | // Package corehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v1" 22 | ) 23 | 24 | // DELETE /open-apis/corehr/v1/companies/:company_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcorehr.NewDeleteCompanyReqBuilder(). 30 | CompanyId("341432424"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Corehr.V1.Company.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/corehrv1/delete_job.go: -------------------------------------------------------------------------------- 1 | // Package corehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v1" 22 | ) 23 | 24 | // DELETE /open-apis/corehr/v1/jobs/:job_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcorehr.NewDeleteJobReqBuilder(). 30 | JobId("67163716371"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Corehr.V1.Job.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/corehrv1/delete_person.go: -------------------------------------------------------------------------------- 1 | // Package corehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v1" 22 | ) 23 | 24 | // DELETE /open-apis/corehr/v1/persons/:person_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcorehr.NewDeletePersonReqBuilder(). 30 | PersonId("654637829201"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Corehr.V1.Person.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/corehrv1/delete_preHire.go: -------------------------------------------------------------------------------- 1 | // Package corehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v1" 22 | ) 23 | 24 | // DELETE /open-apis/corehr/v1/pre_hires/:pre_hire_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcorehr.NewDeletePreHireReqBuilder(). 30 | PreHireId("76534545454"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Corehr.V1.PreHire.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/corehrv1/get_company.go: -------------------------------------------------------------------------------- 1 | // Package corehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v1" 22 | ) 23 | 24 | // GET /open-apis/corehr/v1/companies/:company_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcorehr.NewGetCompanyReqBuilder(). 30 | CompanyId("151515"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Corehr.V1.Company.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/corehrv1/get_contract.go: -------------------------------------------------------------------------------- 1 | // Package corehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v1" 22 | ) 23 | 24 | // GET /open-apis/corehr/v1/contracts/:contract_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcorehr.NewGetContractReqBuilder(). 30 | ContractId("151515"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Corehr.V1.Contract.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/corehrv1/get_currency.go: -------------------------------------------------------------------------------- 1 | // Package corehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v1" 22 | ) 23 | 24 | // GET /open-apis/corehr/v1/currencies/:currency_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcorehr.NewGetCurrencyReqBuilder(). 30 | CurrencyId("67489937334909845"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Corehr.V1.Currency.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/corehrv1/get_job.go: -------------------------------------------------------------------------------- 1 | // Package corehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v1" 22 | ) 23 | 24 | // GET /open-apis/corehr/v1/jobs/:job_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcorehr.NewGetJobReqBuilder(). 30 | JobId("151515"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Corehr.V1.Job.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/corehrv1/get_jobFamily.go: -------------------------------------------------------------------------------- 1 | // Package corehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v1" 22 | ) 23 | 24 | // GET /open-apis/corehr/v1/job_families/:job_family_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcorehr.NewGetJobFamilyReqBuilder(). 30 | JobFamilyId("1554548"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Corehr.V1.JobFamily.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/corehrv1/get_jobLevel.go: -------------------------------------------------------------------------------- 1 | // Package corehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v1" 22 | ) 23 | 24 | // GET /open-apis/corehr/v1/job_levels/:job_level_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcorehr.NewGetJobLevelReqBuilder(). 30 | JobLevelId("1515"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Corehr.V1.JobLevel.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/corehrv1/get_location.go: -------------------------------------------------------------------------------- 1 | // Package corehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v1" 22 | ) 23 | 24 | // GET /open-apis/corehr/v1/locations/:location_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcorehr.NewGetLocationReqBuilder(). 30 | LocationId("1215"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Corehr.V1.Location.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/corehrv1/get_preHire.go: -------------------------------------------------------------------------------- 1 | // Package corehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v1" 22 | ) 23 | 24 | // GET /open-apis/corehr/v1/pre_hires/:pre_hire_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcorehr.NewGetPreHireReqBuilder(). 30 | PreHireId("121215"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Corehr.V1.PreHire.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/corehrv2/get_job.go: -------------------------------------------------------------------------------- 1 | // Package corehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v2" 22 | ) 23 | 24 | // GET /open-apis/corehr/v2/jobs/:job_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkcorehr.NewGetJobReqBuilder(). 30 | JobId("151515"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Corehr.V2.Job.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/drivev1/taskCheck_file.go: -------------------------------------------------------------------------------- 1 | // Package drive code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/drive/v1" 22 | ) 23 | 24 | // GET /open-apis/drive/v1/files/task_check 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkdrive.NewTaskCheckFileReqBuilder(). 30 | TaskId("12345"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Drive.V1.File.TaskCheck(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/ehrv1/get_attachment.go: -------------------------------------------------------------------------------- 1 | // Package ehr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/ehr/v1" 22 | ) 23 | 24 | // GET /open-apis/ehr/v1/attachments/:token 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkehr.NewGetAttachmentReqBuilder(). 30 | Token("09bf7b924f9a4a69875788891b5970d8"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Ehr.V1.Attachment.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/helpdeskv1/agentEmail_agent.go: -------------------------------------------------------------------------------- 1 | // Package helpdesk code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // GET /open-apis/helpdesk/v1/agent_emails 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Helpdesk.V1.Agent.AgentEmail(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/helpdeskv1/delete_faq.go: -------------------------------------------------------------------------------- 1 | // Package helpdesk code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/helpdesk/v1" 22 | ) 23 | 24 | // DELETE /open-apis/helpdesk/v1/faqs/:id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkhelpdesk.NewDeleteFaqReqBuilder(). 30 | Id("12345"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Helpdesk.V1.Faq.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/helpdeskv1/get_faq.go: -------------------------------------------------------------------------------- 1 | // Package helpdesk code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/helpdesk/v1" 22 | ) 23 | 24 | // GET /open-apis/helpdesk/v1/faqs/:id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkhelpdesk.NewGetFaqReqBuilder(). 30 | Id("6856395634652479491"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Helpdesk.V1.Faq.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/helpdeskv1/get_ticket.go: -------------------------------------------------------------------------------- 1 | // Package helpdesk code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/helpdesk/v1" 22 | ) 23 | 24 | // GET /open-apis/helpdesk/v1/tickets/:ticket_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkhelpdesk.NewGetTicketReqBuilder(). 30 | TicketId("123456"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Helpdesk.V1.Ticket.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/helpdeskv1/list_agentSkill.go: -------------------------------------------------------------------------------- 1 | // Package helpdesk code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // GET /open-apis/helpdesk/v1/agent_skills 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Helpdesk.V1.AgentSkill.List(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/helpdeskv1/list_agentSkillRule.go: -------------------------------------------------------------------------------- 1 | // Package helpdesk code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // GET /open-apis/helpdesk/v1/agent_skill_rules 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Helpdesk.V1.AgentSkillRule.List(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/hirev1/close_job.go: -------------------------------------------------------------------------------- 1 | // Package hire code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/hire/v1" 22 | ) 23 | 24 | // POST /open-apis/hire/v1/jobs/:job_id/close 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkhire.NewCloseJobReqBuilder(). 30 | JobId("6960663240925956555"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Hire.V1.Job.Close(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/hirev1/create_attachment.go: -------------------------------------------------------------------------------- 1 | // Package hire code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "os" 22 | ) 23 | 24 | // POST /open-apis/hire/v1/attachments 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | file, err := os.Open("filepath") 29 | if err != nil { 30 | fmt.Println(err) 31 | return 32 | } 33 | // 发起请求 34 | resp, err := client.Hire.V1.Attachment.Create(context.Background()) 35 | 36 | // 处理错误 37 | if err != nil { 38 | fmt.Println(err) 39 | return 40 | } 41 | 42 | // 服务端错误处理 43 | if !resp.Success() { 44 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 45 | return 46 | } 47 | 48 | // 业务处理 49 | fmt.Println(larkcore.Prettify(resp)) 50 | } 51 | -------------------------------------------------------------------------------- /sample/apiall/hirev1/delete_note.go: -------------------------------------------------------------------------------- 1 | // Package hire code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/hire/v1" 22 | ) 23 | 24 | // DELETE /open-apis/hire/v1/notes/:note_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkhire.NewDeleteNoteReqBuilder(). 30 | NoteId(""). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Hire.V1.Note.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/hirev1/get_minutes.go: -------------------------------------------------------------------------------- 1 | // Package hire code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/hire/v1" 22 | ) 23 | 24 | // GET /open-apis/hire/v1/minutes 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkhire.NewGetMinutesReqBuilder(). 30 | InterviewId(""). 31 | PageToken(""). 32 | PageSize(20). 33 | Build() 34 | // 发起请求 35 | resp, err := client.Hire.V1.Minutes.Get(context.Background(), req) 36 | 37 | // 处理错误 38 | if err != nil { 39 | fmt.Println(err) 40 | return 41 | } 42 | 43 | // 服务端错误处理 44 | if !resp.Success() { 45 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 46 | return 47 | } 48 | 49 | // 业务处理 50 | fmt.Println(larkcore.Prettify(resp)) 51 | } 52 | -------------------------------------------------------------------------------- /sample/apiall/hirev1/get_note.go: -------------------------------------------------------------------------------- 1 | // Package hire code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/hire/v1" 22 | ) 23 | 24 | // GET /open-apis/hire/v1/notes/:note_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkhire.NewGetNoteReqBuilder(). 30 | NoteId("6949805467799537964"). 31 | UserIdType("open_id"). 32 | Build() 33 | // 发起请求 34 | resp, err := client.Hire.V1.Note.Get(context.Background(), req) 35 | 36 | // 处理错误 37 | if err != nil { 38 | fmt.Println(err) 39 | return 40 | } 41 | 42 | // 服务端错误处理 43 | if !resp.Success() { 44 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 45 | return 46 | } 47 | 48 | // 业务处理 49 | fmt.Println(larkcore.Prettify(resp)) 50 | } 51 | -------------------------------------------------------------------------------- /sample/apiall/hirev1/get_role.go: -------------------------------------------------------------------------------- 1 | // Package hire code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/hire/v1" 22 | ) 23 | 24 | // GET /open-apis/hire/v1/roles/:role_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkhire.NewGetRoleReqBuilder(). 30 | RoleId(""). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Hire.V1.Role.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/hirev1/list_jobProcess.go: -------------------------------------------------------------------------------- 1 | // Package hire code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/hire/v1" 22 | ) 23 | 24 | // GET /open-apis/hire/v1/job_processes 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkhire.NewListJobProcessReqBuilder(). 30 | PageSize(10). 31 | PageToken("1"). 32 | Build() 33 | // 发起请求 34 | resp, err := client.Hire.V1.JobProcess.List(context.Background(), req) 35 | 36 | // 处理错误 37 | if err != nil { 38 | fmt.Println(err) 39 | return 40 | } 41 | 42 | // 服务端错误处理 43 | if !resp.Success() { 44 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 45 | return 46 | } 47 | 48 | // 业务处理 49 | fmt.Println(larkcore.Prettify(resp)) 50 | } 51 | -------------------------------------------------------------------------------- /sample/apiall/hirev1/list_jobType.go: -------------------------------------------------------------------------------- 1 | // Package hire code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/hire/v1" 22 | ) 23 | 24 | // GET /open-apis/hire/v1/job_types 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkhire.NewListJobTypeReqBuilder(). 30 | PageSize(0). 31 | PageToken(""). 32 | Build() 33 | // 发起请求 34 | resp, err := client.Hire.V1.JobType.List(context.Background(), req) 35 | 36 | // 处理错误 37 | if err != nil { 38 | fmt.Println(err) 39 | return 40 | } 41 | 42 | // 服务端错误处理 43 | if !resp.Success() { 44 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 45 | return 46 | } 47 | 48 | // 业务处理 49 | fmt.Println(larkcore.Prettify(resp)) 50 | } 51 | -------------------------------------------------------------------------------- /sample/apiall/hirev1/query_agency.go: -------------------------------------------------------------------------------- 1 | // Package hire code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/hire/v1" 22 | ) 23 | 24 | // GET /open-apis/hire/v1/agencies/query 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkhire.NewQueryAgencyReqBuilder(). 30 | Name("超越猎头公司"). 31 | UserIdType("user_id"). 32 | Build() 33 | // 发起请求 34 | resp, err := client.Hire.V1.Agency.Query(context.Background(), req) 35 | 36 | // 处理错误 37 | if err != nil { 38 | fmt.Println(err) 39 | return 40 | } 41 | 42 | // 服务端错误处理 43 | if !resp.Success() { 44 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 45 | return 46 | } 47 | 48 | // 业务处理 49 | fmt.Println(larkcore.Prettify(resp)) 50 | } 51 | -------------------------------------------------------------------------------- /sample/apiall/hirev1/query_talentObject.go: -------------------------------------------------------------------------------- 1 | // Package hire code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // GET /open-apis/hire/v1/talent_objects/query 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Hire.V1.TalentObject.Query(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/imv1/delete_chat.go: -------------------------------------------------------------------------------- 1 | // Package im code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/im/v1" 22 | ) 23 | 24 | // DELETE /open-apis/im/v1/chats/:chat_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkim.NewDeleteChatReqBuilder(). 30 | ChatId("oc_a0553eda9014c201e6969b478895c230"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Im.V1.Chat.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/imv1/delete_pin.go: -------------------------------------------------------------------------------- 1 | // Package im code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/im/v1" 22 | ) 23 | 24 | // DELETE /open-apis/im/v1/pins/:message_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkim.NewDeletePinReqBuilder(). 30 | MessageId("om_dc13264520392913993dd051dba21dcf"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Im.V1.Pin.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/imv1/get_file.go: -------------------------------------------------------------------------------- 1 | // Package im code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/im/v1" 22 | ) 23 | 24 | // GET /open-apis/im/v1/files/:file_key 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkim.NewGetFileReqBuilder(). 30 | FileKey("file_456a92d6-c6ea-4de4-ac3f-7afcf44ac78g"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Im.V1.File.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/imv1/get_image.go: -------------------------------------------------------------------------------- 1 | // Package im code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/im/v1" 22 | ) 23 | 24 | // GET /open-apis/im/v1/images/:image_key 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkim.NewGetImageReqBuilder(). 30 | ImageKey("img_8d5181ca-0aed-40f0-b0d1-b1452132afbg"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Im.V1.Image.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/lingov1/download_file.go: -------------------------------------------------------------------------------- 1 | // Package lingo code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/lingo/v1" 22 | ) 23 | 24 | // GET /open-apis/lingo/v1/files/:file_token/download 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larklingo.NewDownloadFileReqBuilder(). 30 | FileToken(""). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Lingo.V1.File.Download(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/lingov1/list_repo.go: -------------------------------------------------------------------------------- 1 | // Package lingo code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // GET /open-apis/lingo/v1/repos 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Lingo.V1.Repo.List(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/okrv1/list_period.go: -------------------------------------------------------------------------------- 1 | // Package okr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/okr/v1" 22 | ) 23 | 24 | // GET /open-apis/okr/v1/periods 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkokr.NewListPeriodReqBuilder(). 30 | PageToken("xaasdasdax"). 31 | PageSize(10). 32 | Build() 33 | // 发起请求 34 | resp, err := client.Okr.V1.Period.List(context.Background(), req) 35 | 36 | // 处理错误 37 | if err != nil { 38 | fmt.Println(err) 39 | return 40 | } 41 | 42 | // 服务端错误处理 43 | if !resp.Success() { 44 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 45 | return 46 | } 47 | 48 | // 业务处理 49 | fmt.Println(larkcore.Prettify(resp)) 50 | } 51 | -------------------------------------------------------------------------------- /sample/apiall/okrv1/list_periodRule.go: -------------------------------------------------------------------------------- 1 | // Package okr code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // GET /open-apis/okr/v1/period_rules 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Okr.V1.PeriodRule.List(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/searchv2/get_schema.go: -------------------------------------------------------------------------------- 1 | // Package search code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/search/v2" 22 | ) 23 | 24 | // GET /open-apis/search/v2/schemas/:schema_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larksearch.NewGetSchemaReqBuilder(). 30 | SchemaId("custom_schema_id"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Search.V2.Schema.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/taskv1/delete_task.go: -------------------------------------------------------------------------------- 1 | // Package task code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/task/v1" 22 | ) 23 | 24 | // DELETE /open-apis/task/v1/tasks/:task_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larktask.NewDeleteTaskReqBuilder(). 30 | TaskId("83912691-2e43-47fc-94a4-d512e03984fa"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Task.V1.Task.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/taskv2/delete_comment.go: -------------------------------------------------------------------------------- 1 | // Package task code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/task/v2" 22 | ) 23 | 24 | // DELETE /open-apis/task/v2/comments/:comment_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larktask.NewDeleteCommentReqBuilder(). 30 | CommentId("7198104824246747156"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Task.V2.Comment.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/tenantv2/query_tenant.go: -------------------------------------------------------------------------------- 1 | // Package tenant code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // GET /open-apis/tenant/v2/tenant/query 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Tenant.V2.Tenant.Query(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/tenantv2/query_tenantProductAssignInfo.go: -------------------------------------------------------------------------------- 1 | // Package tenant code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // GET /open-apis/tenant/v2/tenant/assign_info_list/query 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Tenant.V2.TenantProductAssignInfo.Query(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/vcv1/delete_reserve.go: -------------------------------------------------------------------------------- 1 | // Package vc code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/vc/v1" 22 | ) 23 | 24 | // DELETE /open-apis/vc/v1/reserves/:reserve_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkvc.NewDeleteReserveReqBuilder(). 30 | ReserveId("6911188411932033028"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Vc.V1.Reserve.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/vcv1/delete_room.go: -------------------------------------------------------------------------------- 1 | // Package vc code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/vc/v1" 22 | ) 23 | 24 | // DELETE /open-apis/vc/v1/rooms/:room_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkvc.NewDeleteRoomReqBuilder(). 30 | RoomId("omm_4de32cf10a4358788ff4e09e37ebbf9b"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Vc.V1.Room.Delete(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/vcv1/end_meeting.go: -------------------------------------------------------------------------------- 1 | // Package vc code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/vc/v1" 22 | ) 23 | 24 | // PATCH /open-apis/vc/v1/meetings/:meeting_id/end 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkvc.NewEndMeetingReqBuilder(). 30 | MeetingId("6911188411932033028"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Vc.V1.Meeting.End(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/vcv1/get_export.go: -------------------------------------------------------------------------------- 1 | // Package vc code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/vc/v1" 22 | ) 23 | 24 | // GET /open-apis/vc/v1/exports/:task_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkvc.NewGetExportReqBuilder(). 30 | TaskId("7108646852144136212"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Vc.V1.Export.Get(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/vcv1/search_roomLevel.go: -------------------------------------------------------------------------------- 1 | // Package vc code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/vc/v1" 22 | ) 23 | 24 | // GET /open-apis/vc/v1/room_levels/search 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkvc.NewSearchRoomLevelReqBuilder(). 30 | CustomLevelIds("1000,1001"). 31 | Build() 32 | // 发起请求 33 | resp, err := client.Vc.V1.RoomLevel.Search(context.Background(), req) 34 | 35 | // 处理错误 36 | if err != nil { 37 | fmt.Println(err) 38 | return 39 | } 40 | 41 | // 服务端错误处理 42 | if !resp.Success() { 43 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 44 | return 45 | } 46 | 47 | // 业务处理 48 | fmt.Println(larkcore.Prettify(resp)) 49 | } 50 | -------------------------------------------------------------------------------- /sample/apiall/verificationv1/get_verification.go: -------------------------------------------------------------------------------- 1 | // Package verification code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | ) 22 | 23 | // GET /open-apis/verification/v1/verification 24 | func main() { 25 | // 创建 Client 26 | client := lark.NewClient("appID", "appSecret") 27 | // 发起请求 28 | resp, err := client.Verification.V1.Verification.Get(context.Background()) 29 | 30 | // 处理错误 31 | if err != nil { 32 | fmt.Println(err) 33 | return 34 | } 35 | 36 | // 服务端错误处理 37 | if !resp.Success() { 38 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 39 | return 40 | } 41 | 42 | // 业务处理 43 | fmt.Println(larkcore.Prettify(resp)) 44 | } 45 | -------------------------------------------------------------------------------- /sample/apiall/wikiv2/get_space.go: -------------------------------------------------------------------------------- 1 | // Package wiki code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package main 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "github.com/larksuite/oapi-sdk-go/v3" 20 | "github.com/larksuite/oapi-sdk-go/v3/core" 21 | "github.com/larksuite/oapi-sdk-go/v3/service/wiki/v2" 22 | ) 23 | 24 | // GET /open-apis/wiki/v2/spaces/:space_id 25 | func main() { 26 | // 创建 Client 27 | client := lark.NewClient("appID", "appSecret") 28 | // 创建请求对象 29 | req := larkwiki.NewGetSpaceReqBuilder(). 30 | SpaceId("6870403571079249922"). 31 | Lang("en"). 32 | Build() 33 | // 发起请求 34 | resp, err := client.Wiki.V2.Space.Get(context.Background(), req) 35 | 36 | // 处理错误 37 | if err != nil { 38 | fmt.Println(err) 39 | return 40 | } 41 | 42 | // 服务端错误处理 43 | if !resp.Success() { 44 | fmt.Println(resp.Code, resp.Msg, resp.RequestId()) 45 | return 46 | } 47 | 48 | // 业务处理 49 | fmt.Println(larkcore.Prettify(resp)) 50 | } 51 | -------------------------------------------------------------------------------- /sample/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/larksuite/oapi-sdk-go/sample 2 | 3 | go 1.17 4 | 5 | require github.com/larksuite/oapi-sdk-go/v3 v3.0.0 6 | 7 | replace github.com/larksuite/oapi-sdk-go/v3 => ../ 8 | 9 | require github.com/bytedance/sonic v1.5.0 10 | 11 | require ( 12 | github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06 // indirect 13 | github.com/gogo/protobuf v1.3.2 // indirect 14 | github.com/golang/protobuf v1.5.3 // indirect 15 | github.com/google/uuid v1.4.0 // indirect 16 | github.com/gorilla/websocket v1.5.0 // indirect 17 | github.com/klauspost/cpuid/v2 v2.0.9 // indirect 18 | github.com/twitchyliquid64/golang-asm v0.15.1 // indirect 19 | golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect 20 | google.golang.org/protobuf v1.31.0 // indirect 21 | ) 22 | -------------------------------------------------------------------------------- /sample/ws/sample.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "os" 7 | 8 | larkcore "github.com/larksuite/oapi-sdk-go/v3/core" 9 | larkevent "github.com/larksuite/oapi-sdk-go/v3/event" 10 | "github.com/larksuite/oapi-sdk-go/v3/event/dispatcher" 11 | larkim "github.com/larksuite/oapi-sdk-go/v3/service/im/v1" 12 | larkws "github.com/larksuite/oapi-sdk-go/v3/ws" 13 | ) 14 | 15 | func main() { 16 | // 注册事件回调 17 | eventHandler := dispatcher.NewEventDispatcher("", ""). 18 | OnP2MessageReceiveV1(func(ctx context.Context, event *larkim.P2MessageReceiveV1) error { 19 | fmt.Printf("[ OnP2MessageReceiveV1 access ], data: %s\n", larkcore.Prettify(event)) 20 | return nil 21 | }). 22 | OnCustomizedEvent("这里填入你要自定义订阅的 event 的 key,例如 out_approval", func(ctx context.Context, event *larkevent.EventReq) error { 23 | fmt.Printf("[ OnCustomizedEvent access ], type: message, data: %s\n", string(event.Body)) 24 | return nil 25 | }) 26 | 27 | // 创建Client 28 | cli := larkws.NewClient(os.Getenv("APP_ID"), os.Getenv("APP_SECRET"), 29 | larkws.WithEventHandler(eventHandler), 30 | larkws.WithLogLevel(larkcore.LogLevelDebug), 31 | ) 32 | 33 | // 建立长连接 34 | err := cli.Start(context.Background()) 35 | if err != nil { 36 | panic(err) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /service/acs/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package acs 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/acs/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/admin/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package admin 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/admin/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/aily/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package aily 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/aily/v1" 8 | ) 9 | 10 | type Service struct { 11 | V1 *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/apaas/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package apaas 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/apaas/v1" 8 | ) 9 | 10 | type Service struct { 11 | V1 *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/application/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package application 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v6 "github.com/larksuite/oapi-sdk-go/v3/service/application/v6" 8 | ) 9 | 10 | type Service struct { 11 | *v6.V6 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V6: v6.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/approval/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package approval 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v4 "github.com/larksuite/oapi-sdk-go/v3/service/approval/v4" 8 | ) 9 | 10 | type Service struct { 11 | *v4.V4 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V4: v4.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/approval/v4/event.go: -------------------------------------------------------------------------------- 1 | // Package approval code generated by oapi sdk gen 2 | /* 3 | * MIT License 4 | * 5 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | * 9 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | */ 13 | 14 | package larkapproval 15 | 16 | import ( 17 | "context" 18 | ) 19 | 20 | // 消息处理器定义 21 | type P2ApprovalUpdatedV4Handler struct { 22 | handler func(context.Context, *P2ApprovalUpdatedV4) error 23 | } 24 | 25 | func NewP2ApprovalUpdatedV4Handler(handler func(context.Context, *P2ApprovalUpdatedV4) error) *P2ApprovalUpdatedV4Handler { 26 | h := &P2ApprovalUpdatedV4Handler{handler: handler} 27 | return h 28 | } 29 | 30 | // 返回事件的消息体的实例,用于反序列化用 31 | func (h *P2ApprovalUpdatedV4Handler) Event() interface{} { 32 | return &P2ApprovalUpdatedV4{} 33 | } 34 | 35 | // 回调开发者注册的handle 36 | func (h *P2ApprovalUpdatedV4Handler) Handle(ctx context.Context, event interface{}) error { 37 | return h.handler(ctx, event.(*P2ApprovalUpdatedV4)) 38 | } 39 | -------------------------------------------------------------------------------- /service/attendance/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package attendance 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/attendance/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/auth/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package auth 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v3 "github.com/larksuite/oapi-sdk-go/v3/service/auth/v3" 8 | ) 9 | 10 | type Service struct { 11 | *v3.V3 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V3: v3.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/authen/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package authen 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/authen/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/baike/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package baike 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/baike/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/base/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package base 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v2 "github.com/larksuite/oapi-sdk-go/v3/service/base/v2" 8 | ) 9 | 10 | type Service struct { 11 | V2 *v2.V2 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V2: v2.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/bitable/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package bitable 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/bitable/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/block/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package block 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v2 "github.com/larksuite/oapi-sdk-go/v3/service/block/v2" 8 | ) 9 | 10 | type Service struct { 11 | *v2.V2 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V2: v2.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/board/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package board 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/board/v1" 8 | ) 9 | 10 | type Service struct { 11 | V1 *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/calendar/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package calendar 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v4 "github.com/larksuite/oapi-sdk-go/v3/service/calendar/v4" 8 | ) 9 | 10 | type Service struct { 11 | *v4.V4 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V4: v4.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/cardkit/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package cardkit 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/cardkit/v1" 8 | ) 9 | 10 | type Service struct { 11 | V1 *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/compensation/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package compensation 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/compensation/v1" 8 | ) 9 | 10 | type Service struct { 11 | V1 *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/contact/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package contact 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v3 "github.com/larksuite/oapi-sdk-go/v3/service/contact/v3" 8 | ) 9 | 10 | type Service struct { 11 | *v3.V3 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V3: v3.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/corehr/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package corehr 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v1" 8 | v2 "github.com/larksuite/oapi-sdk-go/v3/service/corehr/v2" 9 | ) 10 | 11 | type Service struct { 12 | *v1.V1 13 | V2 *v2.V2 14 | } 15 | 16 | func NewService(config *larkcore.Config) *Service { 17 | return &Service{ 18 | V1: v1.New(config), 19 | V2: v2.New(config), 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /service/docs/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package docs 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/docs/v1" 8 | ) 9 | 10 | type Service struct { 11 | V1 *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/docs/v1/resource.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package larkdocs 4 | 5 | import ( 6 | "context" 7 | "github.com/larksuite/oapi-sdk-go/v3/core" 8 | "net/http" 9 | ) 10 | 11 | type V1 struct { 12 | Content *content // content 13 | } 14 | 15 | func New(config *larkcore.Config) *V1 { 16 | return &V1{ 17 | Content: &content{config: config}, 18 | } 19 | } 20 | 21 | type content struct { 22 | config *larkcore.Config 23 | } 24 | 25 | // Get 26 | // 27 | // - 获取云文档正文内容 28 | // 29 | // - 官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=docs&resource=content&version=v1 30 | // 31 | // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/docsv1/get_content.go 32 | func (c *content) Get(ctx context.Context, req *GetContentReq, options ...larkcore.RequestOptionFunc) (*GetContentResp, error) { 33 | // 发起请求 34 | apiReq := req.apiReq 35 | apiReq.ApiPath = "/open-apis/docs/v1/content" 36 | apiReq.HttpMethod = http.MethodGet 37 | apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeUser, larkcore.AccessTokenTypeTenant} 38 | apiResp, err := larkcore.Request(ctx, apiReq, c.config, options...) 39 | if err != nil { 40 | return nil, err 41 | } 42 | // 反序列响应结果 43 | resp := &GetContentResp{ApiResp: apiResp} 44 | err = apiResp.JSONUnmarshalBody(resp, c.config) 45 | if err != nil { 46 | return nil, err 47 | } 48 | return resp, err 49 | } 50 | -------------------------------------------------------------------------------- /service/document_ai/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package document_ai 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/document_ai/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/docx/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package docx 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/docx/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/drive/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package drive 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/drive/v1" 8 | v2 "github.com/larksuite/oapi-sdk-go/v3/service/drive/v2" 9 | ) 10 | 11 | type Service struct { 12 | *v1.V1 13 | V2 *v2.V2 14 | } 15 | 16 | func NewService(config *larkcore.Config) *Service { 17 | return &Service{ 18 | V1: v1.New(config), 19 | V2: v2.New(config), 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /service/ehr/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package ehr 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/ehr/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/event/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package event 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/event/v1" 8 | ) 9 | 10 | type Service struct { 11 | V1 *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/event/v1/resource.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package larkevent 4 | 5 | import ( 6 | "context" 7 | "github.com/larksuite/oapi-sdk-go/v3/core" 8 | "net/http" 9 | ) 10 | 11 | type V1 struct { 12 | OutboundIp *outboundIp // 事件订阅 13 | } 14 | 15 | func New(config *larkcore.Config) *V1 { 16 | return &V1{ 17 | OutboundIp: &outboundIp{config: config}, 18 | } 19 | } 20 | 21 | type outboundIp struct { 22 | config *larkcore.Config 23 | } 24 | 25 | // List 获取事件出口 IP 26 | // 27 | // - 飞书开放平台向应用配置的回调地址推送事件时,是通过特定的 IP 发送出去的,应用可以通过本接口获取所有相关的 IP 地址。 28 | // 29 | // - IP 地址有变更可能,建议应用每隔 6 小时定时拉取最新的 IP 地址,以免由于企业防火墙设置,导致应用无法及时接收到飞书开放平台推送的事件。 30 | // 31 | // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/event-v1/outbound_ip/list 32 | // 33 | // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/eventv1/list_outboundIp.go 34 | func (o *outboundIp) List(ctx context.Context, req *ListOutboundIpReq, options ...larkcore.RequestOptionFunc) (*ListOutboundIpResp, error) { 35 | // 发起请求 36 | apiReq := req.apiReq 37 | apiReq.ApiPath = "/open-apis/event/v1/outbound_ip" 38 | apiReq.HttpMethod = http.MethodGet 39 | apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant} 40 | apiResp, err := larkcore.Request(ctx, apiReq, o.config, options...) 41 | if err != nil { 42 | return nil, err 43 | } 44 | // 反序列响应结果 45 | resp := &ListOutboundIpResp{ApiResp: apiResp} 46 | err = apiResp.JSONUnmarshalBody(resp, o.config) 47 | if err != nil { 48 | return nil, err 49 | } 50 | return resp, err 51 | } 52 | func (o *outboundIp) ListByIterator(ctx context.Context, req *ListOutboundIpReq, options ...larkcore.RequestOptionFunc) (*ListOutboundIpIterator, error) { 53 | return &ListOutboundIpIterator{ 54 | ctx: ctx, 55 | req: req, 56 | listFunc: o.List, 57 | options: options, 58 | limit: req.Limit}, nil 59 | } 60 | -------------------------------------------------------------------------------- /service/helpdesk/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package helpdesk 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/helpdesk/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/hire/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package hire 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/hire/v1" 8 | v2 "github.com/larksuite/oapi-sdk-go/v3/service/hire/v2" 9 | ) 10 | 11 | type Service struct { 12 | *v1.V1 13 | V2 *v2.V2 14 | } 15 | 16 | func NewService(config *larkcore.Config) *Service { 17 | return &Service{ 18 | V1: v1.New(config), 19 | V2: v2.New(config), 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /service/human_authentication/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package human_authentication 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/human_authentication/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/human_authentication/v1/resource.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package larkhuman_authentication 4 | 5 | import ( 6 | "context" 7 | "github.com/larksuite/oapi-sdk-go/v3/core" 8 | "net/http" 9 | ) 10 | 11 | type V1 struct { 12 | Identity *identity // 实名认证 13 | } 14 | 15 | func New(config *larkcore.Config) *V1 { 16 | return &V1{ 17 | Identity: &identity{config: config}, 18 | } 19 | } 20 | 21 | type identity struct { 22 | config *larkcore.Config 23 | } 24 | 25 | // Create 录入身份信息 26 | // 27 | // - 该接口用于录入实名认证的身份信息,在唤起有源活体认证前,需要使用该接口进行实名认证。 28 | // 29 | // - 实名认证接口会有计费管理,接入前请联系飞书开放平台工作人员,邮箱:openplatform@bytedance.com。;;仅通过计费申请的应用,才能在[开发者后台](https://open.feishu.cn/app)查找并申请该接口的权限。 30 | // 31 | // - 官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/human_authentication-v1/identity/create 32 | // 33 | // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/human_authenticationv1/create_identity.go 34 | func (i *identity) Create(ctx context.Context, req *CreateIdentityReq, options ...larkcore.RequestOptionFunc) (*CreateIdentityResp, error) { 35 | // 发起请求 36 | apiReq := req.apiReq 37 | apiReq.ApiPath = "/open-apis/human_authentication/v1/identities" 38 | apiReq.HttpMethod = http.MethodPost 39 | apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant} 40 | apiResp, err := larkcore.Request(ctx, apiReq, i.config, options...) 41 | if err != nil { 42 | return nil, err 43 | } 44 | // 反序列响应结果 45 | resp := &CreateIdentityResp{ApiResp: apiResp} 46 | err = apiResp.JSONUnmarshalBody(resp, i.config) 47 | if err != nil { 48 | return nil, err 49 | } 50 | return resp, err 51 | } 52 | -------------------------------------------------------------------------------- /service/im/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package im 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/im/v1" 8 | v2 "github.com/larksuite/oapi-sdk-go/v3/service/im/v2" 9 | ) 10 | 11 | type Service struct { 12 | *v1.V1 13 | V2 *v2.V2 14 | } 15 | 16 | func NewService(config *larkcore.Config) *Service { 17 | return &Service{ 18 | V1: v1.New(config), 19 | V2: v2.New(config), 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /service/lingo/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package lingo 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/lingo/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/mail/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package mail 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/mail/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/mdm/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package mdm 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/mdm/v1" 8 | v3 "github.com/larksuite/oapi-sdk-go/v3/service/mdm/v3" 9 | ) 10 | 11 | type Service struct { 12 | *v1.V1 13 | V3 *v3.V3 14 | } 15 | 16 | func NewService(config *larkcore.Config) *Service { 17 | return &Service{ 18 | V1: v1.New(config), 19 | V3: v3.New(config), 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /service/meeting_room/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package meeting_room 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/meeting_room/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/meeting_room/v1/ext_event.go: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022 Lark Technologies Pte. Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | * 8 | * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | */ 12 | 13 | package larkmeeting_room 14 | 15 | import "context" 16 | 17 | type P1ThirdPartyMeetingRoomChangedV1Handler struct { 18 | handler func(context.Context, *P1ThirdPartyMeetingRoomChangedV1) error 19 | } 20 | 21 | func NewP1ThirdPartyMeetingRoomChangedV1Handler(handler func(context.Context, *P1ThirdPartyMeetingRoomChangedV1) error) *P1ThirdPartyMeetingRoomChangedV1Handler { 22 | h := &P1ThirdPartyMeetingRoomChangedV1Handler{handler: handler} 23 | return h 24 | } 25 | 26 | func (h *P1ThirdPartyMeetingRoomChangedV1Handler) Event() interface{} { 27 | return &P1ThirdPartyMeetingRoomChangedV1{} 28 | } 29 | 30 | func (h *P1ThirdPartyMeetingRoomChangedV1Handler) Handle(ctx context.Context, event interface{}) error { 31 | return h.handler(ctx, event.(*P1ThirdPartyMeetingRoomChangedV1)) 32 | } 33 | -------------------------------------------------------------------------------- /service/meeting_room/v1/resource.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package larkmeeting_room 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | ) 8 | 9 | type V1 struct { 10 | MeetingRoom *meetingRoom // 事件 11 | } 12 | 13 | func New(config *larkcore.Config) *V1 { 14 | return &V1{ 15 | MeetingRoom: &meetingRoom{config: config}, 16 | } 17 | } 18 | 19 | type meetingRoom struct { 20 | config *larkcore.Config 21 | } 22 | -------------------------------------------------------------------------------- /service/minutes/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package minutes 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/minutes/v1" 8 | ) 9 | 10 | type Service struct { 11 | V1 *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/moments/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package moments 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/moments/v1" 8 | ) 9 | 10 | type Service struct { 11 | V1 *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/moments/v1/resource.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package larkmoments 4 | 5 | import ( 6 | "context" 7 | "github.com/larksuite/oapi-sdk-go/v3/core" 8 | "net/http" 9 | ) 10 | 11 | type V1 struct { 12 | Comment *comment // comment 13 | Post *post // post 14 | PostStatistics *postStatistics // post_statistics 15 | Reaction *reaction // reaction 16 | } 17 | 18 | func New(config *larkcore.Config) *V1 { 19 | return &V1{ 20 | Comment: &comment{config: config}, 21 | Post: &post{config: config}, 22 | PostStatistics: &postStatistics{config: config}, 23 | Reaction: &reaction{config: config}, 24 | } 25 | } 26 | 27 | type comment struct { 28 | config *larkcore.Config 29 | } 30 | type post struct { 31 | config *larkcore.Config 32 | } 33 | type postStatistics struct { 34 | config *larkcore.Config 35 | } 36 | type reaction struct { 37 | config *larkcore.Config 38 | } 39 | 40 | // Get 41 | // 42 | // - 43 | // 44 | // - 官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=moments&resource=post&version=v1 45 | // 46 | // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/momentsv1/get_post.go 47 | func (p *post) Get(ctx context.Context, req *GetPostReq, options ...larkcore.RequestOptionFunc) (*GetPostResp, error) { 48 | // 发起请求 49 | apiReq := req.apiReq 50 | apiReq.ApiPath = "/open-apis/moments/v1/posts/:post_id" 51 | apiReq.HttpMethod = http.MethodGet 52 | apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant} 53 | apiResp, err := larkcore.Request(ctx, apiReq, p.config, options...) 54 | if err != nil { 55 | return nil, err 56 | } 57 | // 反序列响应结果 58 | resp := &GetPostResp{ApiResp: apiResp} 59 | err = apiResp.JSONUnmarshalBody(resp, p.config) 60 | if err != nil { 61 | return nil, err 62 | } 63 | return resp, err 64 | } 65 | -------------------------------------------------------------------------------- /service/okr/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package okr 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/okr/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/optical_char_recognition/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package optical_char_recognition 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/optical_char_recognition/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/optical_char_recognition/v1/resource.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package larkoptical_char_recognition 4 | 5 | import ( 6 | "context" 7 | "github.com/larksuite/oapi-sdk-go/v3/core" 8 | "net/http" 9 | ) 10 | 11 | type V1 struct { 12 | Image *image // 图片识别 13 | } 14 | 15 | func New(config *larkcore.Config) *V1 { 16 | return &V1{ 17 | Image: &image{config: config}, 18 | } 19 | } 20 | 21 | type image struct { 22 | config *larkcore.Config 23 | } 24 | 25 | // BasicRecognize 基础图片识别 (OCR) 26 | // 27 | // - 可识别图片中的文字,按图片中的区域划分,分段返回文本列表 28 | // 29 | // - 单租户限流:20QPS,同租户下的应用没有限流,共享本租户的 20QPS 限流 30 | // 31 | // - 官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/ai/optical_char_recognition-v1/image/basic_recognize 32 | // 33 | // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/optical_char_recognitionv1/basicRecognize_image.go 34 | func (i *image) BasicRecognize(ctx context.Context, req *BasicRecognizeImageReq, options ...larkcore.RequestOptionFunc) (*BasicRecognizeImageResp, error) { 35 | // 发起请求 36 | apiReq := req.apiReq 37 | apiReq.ApiPath = "/open-apis/optical_char_recognition/v1/image/basic_recognize" 38 | apiReq.HttpMethod = http.MethodPost 39 | apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant} 40 | apiResp, err := larkcore.Request(ctx, apiReq, i.config, options...) 41 | if err != nil { 42 | return nil, err 43 | } 44 | // 反序列响应结果 45 | resp := &BasicRecognizeImageResp{ApiResp: apiResp} 46 | err = apiResp.JSONUnmarshalBody(resp, i.config) 47 | if err != nil { 48 | return nil, err 49 | } 50 | return resp, err 51 | } 52 | -------------------------------------------------------------------------------- /service/passport/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package passport 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/passport/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/payroll/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package payroll 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/payroll/v1" 8 | ) 9 | 10 | type Service struct { 11 | V1 *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/performance/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package performance 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v2 "github.com/larksuite/oapi-sdk-go/v3/service/performance/v2" 8 | ) 9 | 10 | type Service struct { 11 | V2 *v2.V2 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V2: v2.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/personal_settings/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package personal_settings 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/personal_settings/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/report/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package report 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/report/v1" 8 | ) 9 | 10 | type Service struct { 11 | V1 *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/search/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package search 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v2 "github.com/larksuite/oapi-sdk-go/v3/service/search/v2" 8 | ) 9 | 10 | type Service struct { 11 | *v2.V2 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V2: v2.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/security_and_compliance/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package security_and_compliance 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/security_and_compliance/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/security_and_compliance/v1/resource.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package larksecurity_and_compliance 4 | 5 | import ( 6 | "context" 7 | "github.com/larksuite/oapi-sdk-go/v3/core" 8 | "net/http" 9 | ) 10 | 11 | type V1 struct { 12 | OpenapiLog *openapiLog // openapi_log 13 | } 14 | 15 | func New(config *larkcore.Config) *V1 { 16 | return &V1{ 17 | OpenapiLog: &openapiLog{config: config}, 18 | } 19 | } 20 | 21 | type openapiLog struct { 22 | config *larkcore.Config 23 | } 24 | 25 | // ListData 26 | // 27 | // - 28 | // 29 | // - 官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list_data&project=security_and_compliance&resource=openapi_log&version=v1 30 | // 31 | // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/security_and_compliancev1/listData_openapiLog.go 32 | func (o *openapiLog) ListData(ctx context.Context, req *ListDataOpenapiLogReq, options ...larkcore.RequestOptionFunc) (*ListDataOpenapiLogResp, error) { 33 | // 发起请求 34 | apiReq := req.apiReq 35 | apiReq.ApiPath = "/open-apis/security_and_compliance/v1/openapi_logs/list_data" 36 | apiReq.HttpMethod = http.MethodPost 37 | apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant} 38 | apiResp, err := larkcore.Request(ctx, apiReq, o.config, options...) 39 | if err != nil { 40 | return nil, err 41 | } 42 | // 反序列响应结果 43 | resp := &ListDataOpenapiLogResp{ApiResp: apiResp} 44 | err = apiResp.JSONUnmarshalBody(resp, o.config) 45 | if err != nil { 46 | return nil, err 47 | } 48 | return resp, err 49 | } 50 | -------------------------------------------------------------------------------- /service/sheets/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package sheets 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v3 "github.com/larksuite/oapi-sdk-go/v3/service/sheets/v3" 8 | ) 9 | 10 | type Service struct { 11 | *v3.V3 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V3: v3.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/speech_to_text/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package speech_to_text 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/speech_to_text/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/task/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package task 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/task/v1" 8 | v2 "github.com/larksuite/oapi-sdk-go/v3/service/task/v2" 9 | ) 10 | 11 | type Service struct { 12 | *v1.V1 13 | V2 *v2.V2 14 | } 15 | 16 | func NewService(config *larkcore.Config) *Service { 17 | return &Service{ 18 | V1: v1.New(config), 19 | V2: v2.New(config), 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /service/tenant/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package tenant 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v2 "github.com/larksuite/oapi-sdk-go/v3/service/tenant/v2" 8 | ) 9 | 10 | type Service struct { 11 | *v2.V2 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V2: v2.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/translation/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package translation 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/translation/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/vc/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package vc 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/vc/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/verification/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package verification 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/verification/v1" 8 | ) 9 | 10 | type Service struct { 11 | V1 *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/verification/v1/resource.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package larkverification 4 | 5 | import ( 6 | "context" 7 | "github.com/larksuite/oapi-sdk-go/v3/core" 8 | "net/http" 9 | ) 10 | 11 | type V1 struct { 12 | Verification *verification // 认证信息 13 | } 14 | 15 | func New(config *larkcore.Config) *V1 { 16 | return &V1{ 17 | Verification: &verification{config: config}, 18 | } 19 | } 20 | 21 | type verification struct { 22 | config *larkcore.Config 23 | } 24 | 25 | // Get 获取认证信息 26 | // 27 | // - 获取企业主体名称、是否认证等信息。 28 | // 29 | // - 官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/verification-v1/verification/get 30 | // 31 | // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/verificationv1/get_verification.go 32 | func (v *verification) Get(ctx context.Context, options ...larkcore.RequestOptionFunc) (*GetVerificationResp, error) { 33 | // 发起请求 34 | apiReq := &larkcore.ApiReq{ 35 | PathParams: larkcore.PathParams{}, 36 | QueryParams: larkcore.QueryParams{}, 37 | } 38 | apiReq.ApiPath = "/open-apis/verification/v1/verification" 39 | apiReq.HttpMethod = http.MethodGet 40 | apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant} 41 | apiResp, err := larkcore.Request(ctx, apiReq, v.config, options...) 42 | if err != nil { 43 | return nil, err 44 | } 45 | // 反序列响应结果 46 | resp := &GetVerificationResp{ApiResp: apiResp} 47 | err = apiResp.JSONUnmarshalBody(resp, v.config) 48 | if err != nil { 49 | return nil, err 50 | } 51 | return resp, err 52 | } 53 | -------------------------------------------------------------------------------- /service/wiki/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package wiki 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v2 "github.com/larksuite/oapi-sdk-go/v3/service/wiki/v2" 8 | ) 9 | 10 | type Service struct { 11 | *v2.V2 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V2: v2.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /service/workplace/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by Lark OpenAPI. 2 | 3 | package workplace 4 | 5 | import ( 6 | "github.com/larksuite/oapi-sdk-go/v3/core" 7 | v1 "github.com/larksuite/oapi-sdk-go/v3/service/workplace/v1" 8 | ) 9 | 10 | type Service struct { 11 | *v1.V1 12 | } 13 | 14 | func NewService(config *larkcore.Config) *Service { 15 | return &Service{ 16 | V1: v1.New(config), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ws/const.go: -------------------------------------------------------------------------------- 1 | package ws 2 | 3 | const ( 4 | GenEndpointUri = "/callback/ws/endpoint" 5 | DeviceID = "device_id" 6 | ServiceID = "service_id" 7 | ) 8 | 9 | const ( 10 | HeaderTimestamp = "timestamp" // 消息时间戳, 单位ms 11 | HeaderType = "type" // 消息类型, Event/Card 12 | HeaderMessageID = "message_id" // 消息ID, 拆包后继承 13 | HeaderSum = "sum" // 拆包数, 未拆包为1 14 | HeaderSeq = "seq" // 包序号, 未拆包为0 15 | HeaderTraceID = "trace_id" // 链路ID 16 | HeaderInstanceID = "instance_id" // 标识下行消息来源及上行消息去向的机器实例地址, 由 ip、port、pod_name 等信息加密获得 17 | HeaderBizRt = "biz_rt" // 业务处理时长,单位ms 18 | HeaderHandshakeStatus = "Handshake-Status" 19 | HeaderHandshakeMsg = "Handshake-Msg" 20 | HeaderHandshakeAuthErrCode = "Handshake-Autherrcode" 21 | ) 22 | 23 | type MessageType string 24 | 25 | const ( 26 | MessageTypeEvent MessageType = "event" 27 | MessageTypeCard MessageType = "card" 28 | MessageTypePing MessageType = "ping" 29 | MessageTypePong MessageType = "pong" 30 | ) 31 | 32 | type FrameType int 33 | 34 | const ( 35 | FrameTypeControl FrameType = 0 36 | FrameTypeData FrameType = 1 37 | ) 38 | 39 | const ( 40 | OK = 0 41 | SystemBusy = 1 42 | Forbidden = 403 43 | AuthFailed = 514 44 | ExceedConnLimit = 1000040350 45 | InternalError = 1000040343 46 | ) 47 | -------------------------------------------------------------------------------- /ws/error.go: -------------------------------------------------------------------------------- 1 | package ws 2 | 3 | import "fmt" 4 | 5 | type ClientError struct { 6 | Code int 7 | Msg string 8 | } 9 | 10 | func (e *ClientError) Error() string { 11 | return fmt.Sprintf("%d: %s", e.Code, e.Msg) 12 | } 13 | 14 | func NewClientError(code int, msg string) *ClientError { 15 | return &ClientError{ 16 | code, 17 | msg, 18 | } 19 | } 20 | 21 | type ServerError struct { 22 | Code int 23 | Msg string 24 | } 25 | 26 | func (e *ServerError) Error() string { 27 | return fmt.Sprintf("%d: %s", e.Code, e.Msg) 28 | } 29 | 30 | func NewServerError(code int, msg string) *ServerError { 31 | return &ServerError{ 32 | code, 33 | msg, 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ws/model.go: -------------------------------------------------------------------------------- 1 | package ws 2 | 3 | import "strconv" 4 | 5 | type EndpointResp struct { 6 | Code int `json:"code"` 7 | Msg string `json:"msg"` 8 | Data *Endpoint `json:"data"` 9 | } 10 | 11 | type Endpoint struct { 12 | Url string `json:"URL,omitempty"` 13 | ClientConfig *ClientConfig `json:"ClientConfig,omitempty"` 14 | } 15 | 16 | // ClientConfig 由服务端下发 17 | type ClientConfig struct { 18 | ReconnectCount int `json:"ReconnectCount,omitempty"` 19 | ReconnectInterval int `json:"ReconnectInterval,omitempty"` 20 | ReconnectNonce int `json:"ReconnectNonce,omitempty"` 21 | PingInterval int `json:"PingInterval,omitempty"` 22 | } 23 | 24 | // Headers Frame.Headers 25 | type Headers []Header 26 | 27 | func (h Headers) GetString(key string) string { 28 | for _, header := range h { 29 | if header.Key == key { 30 | return header.Value 31 | } 32 | } 33 | 34 | return "" 35 | } 36 | 37 | func (h Headers) GetInt(key string) int { 38 | for _, header := range h { 39 | if header.Key == key { 40 | if val, err := strconv.Atoi(header.Value); err == nil { 41 | return val 42 | } 43 | } 44 | } 45 | 46 | return 0 47 | } 48 | 49 | func (h *Headers) Add(key, value string) { 50 | header := Header{ 51 | Key: key, 52 | Value: value, 53 | } 54 | *h = append(*h, header) 55 | } 56 | 57 | // Response 上行响应消息结构, 置于 Frame.Payload 58 | type Response struct { 59 | StatusCode int `json:"code"` 60 | Headers map[string]string `json:"headers"` 61 | Data []byte `json:"data"` 62 | } 63 | 64 | func NewResponseByCode(code int) *Response { 65 | return &Response{ 66 | StatusCode: code, 67 | } 68 | } 69 | 70 | func NewPingFrame(serviceID int32) *Frame { 71 | headers := Headers{} 72 | headers.Add(HeaderType, string(MessageTypePing)) 73 | return &Frame{ 74 | Method: int32(FrameTypeControl), 75 | Service: serviceID, 76 | Headers: headers, 77 | } 78 | } 79 | --------------------------------------------------------------------------------