gitee.com/larksuite/oapi-sdk-go/v3@v3.0.3/service/hire/v1/api.go (about)

     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 larkhire
    15  
    16  import (
    17  	"context"
    18  	"net/http"
    19  
    20  	"gitee.com/larksuite/oapi-sdk-go/v3/core"
    21  )
    22  
    23  func NewService(config *larkcore.Config) *HireService {
    24  	h := &HireService{config: config}
    25  	h.Application = &application{service: h}
    26  	h.ApplicationInterview = &applicationInterview{service: h}
    27  	h.Attachment = &attachment{service: h}
    28  	h.Employee = &employee{service: h}
    29  	h.Job = &job{service: h}
    30  	h.JobManager = &jobManager{service: h}
    31  	h.JobProcess = &jobProcess{service: h}
    32  	h.Note = &note{service: h}
    33  	h.OfferSchema = &offerSchema{service: h}
    34  	h.Referral = &referral{service: h}
    35  	h.ResumeSource = &resumeSource{service: h}
    36  	h.Talent = &talent{service: h}
    37  	return h
    38  }
    39  
    40  type HireService struct {
    41  	config               *larkcore.Config
    42  	Application          *application          // 投递
    43  	ApplicationInterview *applicationInterview // 面试
    44  	Attachment           *attachment           // 附件
    45  	Employee             *employee             // 入职
    46  	Job                  *job                  // 职位
    47  	JobManager           *jobManager           // job.manager
    48  	JobProcess           *jobProcess           // 流程
    49  	Note                 *note                 // 备注
    50  	OfferSchema          *offerSchema          // offer
    51  	Referral             *referral             // 内推
    52  	ResumeSource         *resumeSource         // 简历来源
    53  	Talent               *talent               // 人才
    54  }
    55  
    56  type application struct {
    57  	service *HireService
    58  }
    59  type applicationInterview struct {
    60  	service *HireService
    61  }
    62  type attachment struct {
    63  	service *HireService
    64  }
    65  type employee struct {
    66  	service *HireService
    67  }
    68  type job struct {
    69  	service *HireService
    70  }
    71  type jobManager struct {
    72  	service *HireService
    73  }
    74  type jobProcess struct {
    75  	service *HireService
    76  }
    77  type note struct {
    78  	service *HireService
    79  }
    80  type offerSchema struct {
    81  	service *HireService
    82  }
    83  type referral struct {
    84  	service *HireService
    85  }
    86  type resumeSource struct {
    87  	service *HireService
    88  }
    89  type talent struct {
    90  	service *HireService
    91  }
    92  
    93  // 创建投递
    94  //
    95  // - 根据人才 ID 和职位 ID 创建投递
    96  //
    97  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uQzM1YjL0MTN24CNzUjN/create_application
    98  //
    99  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/create_application.go
   100  func (a *application) Create(ctx context.Context, req *CreateApplicationReq, options ...larkcore.RequestOptionFunc) (*CreateApplicationResp, error) {
   101  	// 发起请求
   102  	apiReq := req.apiReq
   103  	apiReq.ApiPath = "/open-apis/hire/v1/applications"
   104  	apiReq.HttpMethod = http.MethodPost
   105  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   106  	apiResp, err := larkcore.Request(ctx, apiReq, a.service.config, options...)
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	// 反序列响应结果
   111  	resp := &CreateApplicationResp{ApiResp: apiResp}
   112  	err = apiResp.JSONUnmarshalBody(resp)
   113  	if err != nil {
   114  		return nil, err
   115  	}
   116  	return resp, err
   117  }
   118  
   119  // 获取投递信息
   120  //
   121  // - 根据投递 ID 获取单个投递信息
   122  //
   123  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uQzM1YjL0MTN24CNzUjN/get-application
   124  //
   125  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/get_application.go
   126  func (a *application) Get(ctx context.Context, req *GetApplicationReq, options ...larkcore.RequestOptionFunc) (*GetApplicationResp, error) {
   127  	// 发起请求
   128  	apiReq := req.apiReq
   129  	apiReq.ApiPath = "/open-apis/hire/v1/applications/:application_id"
   130  	apiReq.HttpMethod = http.MethodGet
   131  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   132  	apiResp, err := larkcore.Request(ctx, apiReq, a.service.config, options...)
   133  	if err != nil {
   134  		return nil, err
   135  	}
   136  	// 反序列响应结果
   137  	resp := &GetApplicationResp{ApiResp: apiResp}
   138  	err = apiResp.JSONUnmarshalBody(resp)
   139  	if err != nil {
   140  		return nil, err
   141  	}
   142  	return resp, err
   143  }
   144  
   145  // 获取投递列表
   146  //
   147  // - 根据限定条件获取投递列表信息
   148  //
   149  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uQzM1YjL0MTN24CNzUjN/get-application-list
   150  //
   151  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/list_application.go
   152  func (a *application) List(ctx context.Context, req *ListApplicationReq, options ...larkcore.RequestOptionFunc) (*ListApplicationResp, error) {
   153  	// 发起请求
   154  	apiReq := req.apiReq
   155  	apiReq.ApiPath = "/open-apis/hire/v1/applications"
   156  	apiReq.HttpMethod = http.MethodGet
   157  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   158  	apiResp, err := larkcore.Request(ctx, apiReq, a.service.config, options...)
   159  	if err != nil {
   160  		return nil, err
   161  	}
   162  	// 反序列响应结果
   163  	resp := &ListApplicationResp{ApiResp: apiResp}
   164  	err = apiResp.JSONUnmarshalBody(resp)
   165  	if err != nil {
   166  		return nil, err
   167  	}
   168  	return resp, err
   169  }
   170  
   171  // 获取 Offer 信息
   172  //
   173  // - 根据投递 ID 获取 Offer 信息
   174  //
   175  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uQzM1YjL0MTN24CNzUjN/get-application-offer
   176  //
   177  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/offer_application.go
   178  func (a *application) Offer(ctx context.Context, req *OfferApplicationReq, options ...larkcore.RequestOptionFunc) (*OfferApplicationResp, error) {
   179  	// 发起请求
   180  	apiReq := req.apiReq
   181  	apiReq.ApiPath = "/open-apis/hire/v1/applications/:application_id/offer"
   182  	apiReq.HttpMethod = http.MethodGet
   183  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   184  	apiResp, err := larkcore.Request(ctx, apiReq, a.service.config, options...)
   185  	if err != nil {
   186  		return nil, err
   187  	}
   188  	// 反序列响应结果
   189  	resp := &OfferApplicationResp{ApiResp: apiResp}
   190  	err = apiResp.JSONUnmarshalBody(resp)
   191  	if err != nil {
   192  		return nil, err
   193  	}
   194  	return resp, err
   195  }
   196  
   197  // 终止投递
   198  //
   199  // - 根据投递 ID 修改投递状态为「已终止」
   200  //
   201  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uQzM1YjL0MTN24CNzUjN/terminate-application
   202  //
   203  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/terminate_application.go
   204  func (a *application) Terminate(ctx context.Context, req *TerminateApplicationReq, options ...larkcore.RequestOptionFunc) (*TerminateApplicationResp, error) {
   205  	// 发起请求
   206  	apiReq := req.apiReq
   207  	apiReq.ApiPath = "/open-apis/hire/v1/applications/:application_id/terminate"
   208  	apiReq.HttpMethod = http.MethodPost
   209  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   210  	apiResp, err := larkcore.Request(ctx, apiReq, a.service.config, options...)
   211  	if err != nil {
   212  		return nil, err
   213  	}
   214  	// 反序列响应结果
   215  	resp := &TerminateApplicationResp{ApiResp: apiResp}
   216  	err = apiResp.JSONUnmarshalBody(resp)
   217  	if err != nil {
   218  		return nil, err
   219  	}
   220  	return resp, err
   221  }
   222  
   223  // 操作候选人入职
   224  //
   225  // - 根据投递 ID 操作候选人入职并创建员工。投递须处于「待入职」阶段,可通过「转移阶段」接口变更投递状态
   226  //
   227  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uczM1YjL3MTN24yNzUjN
   228  //
   229  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/transferOnboard_application.go
   230  func (a *application) TransferOnboard(ctx context.Context, req *TransferOnboardApplicationReq, options ...larkcore.RequestOptionFunc) (*TransferOnboardApplicationResp, error) {
   231  	// 发起请求
   232  	apiReq := req.apiReq
   233  	apiReq.ApiPath = "/open-apis/hire/v1/applications/:application_id/transfer_onboard"
   234  	apiReq.HttpMethod = http.MethodPost
   235  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   236  	apiResp, err := larkcore.Request(ctx, apiReq, a.service.config, options...)
   237  	if err != nil {
   238  		return nil, err
   239  	}
   240  	// 反序列响应结果
   241  	resp := &TransferOnboardApplicationResp{ApiResp: apiResp}
   242  	err = apiResp.JSONUnmarshalBody(resp)
   243  	if err != nil {
   244  		return nil, err
   245  	}
   246  	return resp, err
   247  }
   248  
   249  // 获取面试记录列表
   250  //
   251  // - 根据投递 ID 获取面试记录列表
   252  //
   253  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application-interview/list
   254  //
   255  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/list_applicationInterview.go
   256  func (a *applicationInterview) List(ctx context.Context, req *ListApplicationInterviewReq, options ...larkcore.RequestOptionFunc) (*ListApplicationInterviewResp, error) {
   257  	// 发起请求
   258  	apiReq := req.apiReq
   259  	apiReq.ApiPath = "/open-apis/hire/v1/applications/:application_id/interviews"
   260  	apiReq.HttpMethod = http.MethodGet
   261  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   262  	apiResp, err := larkcore.Request(ctx, apiReq, a.service.config, options...)
   263  	if err != nil {
   264  		return nil, err
   265  	}
   266  	// 反序列响应结果
   267  	resp := &ListApplicationInterviewResp{ApiResp: apiResp}
   268  	err = apiResp.JSONUnmarshalBody(resp)
   269  	if err != nil {
   270  		return nil, err
   271  	}
   272  	return resp, err
   273  }
   274  
   275  // 获取附件信息
   276  //
   277  // - 获取招聘系统中附件的元信息,比如文件名、创建时间、文件url等
   278  //
   279  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/get
   280  //
   281  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/get_attachment.go
   282  func (a *attachment) Get(ctx context.Context, req *GetAttachmentReq, options ...larkcore.RequestOptionFunc) (*GetAttachmentResp, error) {
   283  	// 发起请求
   284  	apiReq := req.apiReq
   285  	apiReq.ApiPath = "/open-apis/hire/v1/attachments/:attachment_id"
   286  	apiReq.HttpMethod = http.MethodGet
   287  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   288  	apiResp, err := larkcore.Request(ctx, apiReq, a.service.config, options...)
   289  	if err != nil {
   290  		return nil, err
   291  	}
   292  	// 反序列响应结果
   293  	resp := &GetAttachmentResp{ApiResp: apiResp}
   294  	err = apiResp.JSONUnmarshalBody(resp)
   295  	if err != nil {
   296  		return nil, err
   297  	}
   298  	return resp, err
   299  }
   300  
   301  // 获取附件预览信息
   302  //
   303  // - 根据附件 ID 获取附件预览信息
   304  //
   305  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/attachment/preview
   306  //
   307  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/preview_attachment.go
   308  func (a *attachment) Preview(ctx context.Context, req *PreviewAttachmentReq, options ...larkcore.RequestOptionFunc) (*PreviewAttachmentResp, error) {
   309  	// 发起请求
   310  	apiReq := req.apiReq
   311  	apiReq.ApiPath = "/open-apis/hire/v1/attachments/:attachment_id/preview"
   312  	apiReq.HttpMethod = http.MethodGet
   313  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   314  	apiResp, err := larkcore.Request(ctx, apiReq, a.service.config, options...)
   315  	if err != nil {
   316  		return nil, err
   317  	}
   318  	// 反序列响应结果
   319  	resp := &PreviewAttachmentResp{ApiResp: apiResp}
   320  	err = apiResp.JSONUnmarshalBody(resp)
   321  	if err != nil {
   322  		return nil, err
   323  	}
   324  	return resp, err
   325  }
   326  
   327  // 通过员工 ID 获取入职信息
   328  //
   329  // - 通过员工 ID 获取入职信息
   330  //
   331  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get
   332  //
   333  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/get_employee.go
   334  func (e *employee) Get(ctx context.Context, req *GetEmployeeReq, options ...larkcore.RequestOptionFunc) (*GetEmployeeResp, error) {
   335  	// 发起请求
   336  	apiReq := req.apiReq
   337  	apiReq.ApiPath = "/open-apis/hire/v1/employees/:employee_id"
   338  	apiReq.HttpMethod = http.MethodGet
   339  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   340  	apiResp, err := larkcore.Request(ctx, apiReq, e.service.config, options...)
   341  	if err != nil {
   342  		return nil, err
   343  	}
   344  	// 反序列响应结果
   345  	resp := &GetEmployeeResp{ApiResp: apiResp}
   346  	err = apiResp.JSONUnmarshalBody(resp)
   347  	if err != nil {
   348  		return nil, err
   349  	}
   350  	return resp, err
   351  }
   352  
   353  // 通过投递 ID 获取入职信息
   354  //
   355  // - 通过投递 ID 获取入职信息
   356  //
   357  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/get_by_application
   358  //
   359  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/getByApplication_employee.go
   360  func (e *employee) GetByApplication(ctx context.Context, req *GetByApplicationEmployeeReq, options ...larkcore.RequestOptionFunc) (*GetByApplicationEmployeeResp, error) {
   361  	// 发起请求
   362  	apiReq := req.apiReq
   363  	apiReq.ApiPath = "/open-apis/hire/v1/employees/get_by_application"
   364  	apiReq.HttpMethod = http.MethodGet
   365  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   366  	apiResp, err := larkcore.Request(ctx, apiReq, e.service.config, options...)
   367  	if err != nil {
   368  		return nil, err
   369  	}
   370  	// 反序列响应结果
   371  	resp := &GetByApplicationEmployeeResp{ApiResp: apiResp}
   372  	err = apiResp.JSONUnmarshalBody(resp)
   373  	if err != nil {
   374  		return nil, err
   375  	}
   376  	return resp, err
   377  }
   378  
   379  // 更新入职状态
   380  //
   381  // - 根据员工 ID 更新员工转正、离职状态
   382  //
   383  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/employee/patch
   384  //
   385  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/patch_employee.go
   386  func (e *employee) Patch(ctx context.Context, req *PatchEmployeeReq, options ...larkcore.RequestOptionFunc) (*PatchEmployeeResp, error) {
   387  	// 发起请求
   388  	apiReq := req.apiReq
   389  	apiReq.ApiPath = "/open-apis/hire/v1/employees/:employee_id"
   390  	apiReq.HttpMethod = http.MethodPatch
   391  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   392  	apiResp, err := larkcore.Request(ctx, apiReq, e.service.config, options...)
   393  	if err != nil {
   394  		return nil, err
   395  	}
   396  	// 反序列响应结果
   397  	resp := &PatchEmployeeResp{ApiResp: apiResp}
   398  	err = apiResp.JSONUnmarshalBody(resp)
   399  	if err != nil {
   400  		return nil, err
   401  	}
   402  	return resp, err
   403  }
   404  
   405  // 获取职位信息
   406  //
   407  // - 根据职位 ID 获取职位信息
   408  //
   409  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/job/get-job
   410  //
   411  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/get_job.go
   412  func (j *job) Get(ctx context.Context, req *GetJobReq, options ...larkcore.RequestOptionFunc) (*GetJobResp, error) {
   413  	// 发起请求
   414  	apiReq := req.apiReq
   415  	apiReq.ApiPath = "/open-apis/hire/v1/jobs/:job_id"
   416  	apiReq.HttpMethod = http.MethodGet
   417  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   418  	apiResp, err := larkcore.Request(ctx, apiReq, j.service.config, options...)
   419  	if err != nil {
   420  		return nil, err
   421  	}
   422  	// 反序列响应结果
   423  	resp := &GetJobResp{ApiResp: apiResp}
   424  	err = apiResp.JSONUnmarshalBody(resp)
   425  	if err != nil {
   426  		return nil, err
   427  	}
   428  	return resp, err
   429  }
   430  
   431  // 获取职位上的招聘人员信息
   432  //
   433  // - 根据职位 ID 获取职位上的招聘人员信息,如招聘负责人、用人经理
   434  //
   435  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job-manager/get
   436  //
   437  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/get_jobManager.go
   438  func (j *jobManager) Get(ctx context.Context, req *GetJobManagerReq, options ...larkcore.RequestOptionFunc) (*GetJobManagerResp, error) {
   439  	// 发起请求
   440  	apiReq := req.apiReq
   441  	apiReq.ApiPath = "/open-apis/hire/v1/jobs/:job_id/managers/:manager_id"
   442  	apiReq.HttpMethod = http.MethodGet
   443  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   444  	apiResp, err := larkcore.Request(ctx, apiReq, j.service.config, options...)
   445  	if err != nil {
   446  		return nil, err
   447  	}
   448  	// 反序列响应结果
   449  	resp := &GetJobManagerResp{ApiResp: apiResp}
   450  	err = apiResp.JSONUnmarshalBody(resp)
   451  	if err != nil {
   452  		return nil, err
   453  	}
   454  	return resp, err
   455  }
   456  
   457  // 获取招聘流程信息
   458  //
   459  // - 获取全部招聘流程信息
   460  //
   461  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/jop-process/get-process
   462  //
   463  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/list_jobProcess.go
   464  func (j *jobProcess) List(ctx context.Context, req *ListJobProcessReq, options ...larkcore.RequestOptionFunc) (*ListJobProcessResp, error) {
   465  	// 发起请求
   466  	apiReq := req.apiReq
   467  	apiReq.ApiPath = "/open-apis/hire/v1/job_processes"
   468  	apiReq.HttpMethod = http.MethodGet
   469  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   470  	apiResp, err := larkcore.Request(ctx, apiReq, j.service.config, options...)
   471  	if err != nil {
   472  		return nil, err
   473  	}
   474  	// 反序列响应结果
   475  	resp := &ListJobProcessResp{ApiResp: apiResp}
   476  	err = apiResp.JSONUnmarshalBody(resp)
   477  	if err != nil {
   478  		return nil, err
   479  	}
   480  	return resp, err
   481  }
   482  
   483  // 创建备注
   484  //
   485  // - 创建备注信息
   486  //
   487  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/create
   488  //
   489  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/create_note.go
   490  func (n *note) Create(ctx context.Context, req *CreateNoteReq, options ...larkcore.RequestOptionFunc) (*CreateNoteResp, error) {
   491  	// 发起请求
   492  	apiReq := req.apiReq
   493  	apiReq.ApiPath = "/open-apis/hire/v1/notes"
   494  	apiReq.HttpMethod = http.MethodPost
   495  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   496  	apiResp, err := larkcore.Request(ctx, apiReq, n.service.config, options...)
   497  	if err != nil {
   498  		return nil, err
   499  	}
   500  	// 反序列响应结果
   501  	resp := &CreateNoteResp{ApiResp: apiResp}
   502  	err = apiResp.JSONUnmarshalBody(resp)
   503  	if err != nil {
   504  		return nil, err
   505  	}
   506  	return resp, err
   507  }
   508  
   509  // 获取备注
   510  //
   511  // - 根据备注 ID 获取备注信息
   512  //
   513  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/get
   514  //
   515  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/get_note.go
   516  func (n *note) Get(ctx context.Context, req *GetNoteReq, options ...larkcore.RequestOptionFunc) (*GetNoteResp, error) {
   517  	// 发起请求
   518  	apiReq := req.apiReq
   519  	apiReq.ApiPath = "/open-apis/hire/v1/notes/:note_id"
   520  	apiReq.HttpMethod = http.MethodGet
   521  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   522  	apiResp, err := larkcore.Request(ctx, apiReq, n.service.config, options...)
   523  	if err != nil {
   524  		return nil, err
   525  	}
   526  	// 反序列响应结果
   527  	resp := &GetNoteResp{ApiResp: apiResp}
   528  	err = apiResp.JSONUnmarshalBody(resp)
   529  	if err != nil {
   530  		return nil, err
   531  	}
   532  	return resp, err
   533  }
   534  
   535  // 获取备注列表
   536  //
   537  // - 获取备注列表
   538  //
   539  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/list
   540  //
   541  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/list_note.go
   542  func (n *note) List(ctx context.Context, req *ListNoteReq, options ...larkcore.RequestOptionFunc) (*ListNoteResp, error) {
   543  	// 发起请求
   544  	apiReq := req.apiReq
   545  	apiReq.ApiPath = "/open-apis/hire/v1/notes"
   546  	apiReq.HttpMethod = http.MethodGet
   547  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   548  	apiResp, err := larkcore.Request(ctx, apiReq, n.service.config, options...)
   549  	if err != nil {
   550  		return nil, err
   551  	}
   552  	// 反序列响应结果
   553  	resp := &ListNoteResp{ApiResp: apiResp}
   554  	err = apiResp.JSONUnmarshalBody(resp)
   555  	if err != nil {
   556  		return nil, err
   557  	}
   558  	return resp, err
   559  }
   560  
   561  // 更新备注
   562  //
   563  // - 根据备注 ID 更新备注信息
   564  //
   565  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/note/patch
   566  //
   567  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/patch_note.go
   568  func (n *note) Patch(ctx context.Context, req *PatchNoteReq, options ...larkcore.RequestOptionFunc) (*PatchNoteResp, error) {
   569  	// 发起请求
   570  	apiReq := req.apiReq
   571  	apiReq.ApiPath = "/open-apis/hire/v1/notes/:note_id"
   572  	apiReq.HttpMethod = http.MethodPatch
   573  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   574  	apiResp, err := larkcore.Request(ctx, apiReq, n.service.config, options...)
   575  	if err != nil {
   576  		return nil, err
   577  	}
   578  	// 反序列响应结果
   579  	resp := &PatchNoteResp{ApiResp: apiResp}
   580  	err = apiResp.JSONUnmarshalBody(resp)
   581  	if err != nil {
   582  		return nil, err
   583  	}
   584  	return resp, err
   585  }
   586  
   587  // 获取 Offer 申请表详细信息
   588  //
   589  // - 根据 Offer 申请表 ID,获取 Offer 申请表的详细信息
   590  //
   591  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer_schema/get
   592  //
   593  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/get_offerSchema.go
   594  func (o *offerSchema) Get(ctx context.Context, req *GetOfferSchemaReq, options ...larkcore.RequestOptionFunc) (*GetOfferSchemaResp, error) {
   595  	// 发起请求
   596  	apiReq := req.apiReq
   597  	apiReq.ApiPath = "/open-apis/hire/v1/offer_schemas/:offer_schema_id"
   598  	apiReq.HttpMethod = http.MethodGet
   599  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   600  	apiResp, err := larkcore.Request(ctx, apiReq, o.service.config, options...)
   601  	if err != nil {
   602  		return nil, err
   603  	}
   604  	// 反序列响应结果
   605  	resp := &GetOfferSchemaResp{ApiResp: apiResp}
   606  	err = apiResp.JSONUnmarshalBody(resp)
   607  	if err != nil {
   608  		return nil, err
   609  	}
   610  	return resp, err
   611  }
   612  
   613  // 获取内推信息
   614  //
   615  // - 根据投递 ID 获取内推信息
   616  //
   617  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral/get_by_application
   618  //
   619  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/getByApplication_referral.go
   620  func (r *referral) GetByApplication(ctx context.Context, req *GetByApplicationReferralReq, options ...larkcore.RequestOptionFunc) (*GetByApplicationReferralResp, error) {
   621  	// 发起请求
   622  	apiReq := req.apiReq
   623  	apiReq.ApiPath = "/open-apis/hire/v1/referrals/get_by_application"
   624  	apiReq.HttpMethod = http.MethodGet
   625  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   626  	apiResp, err := larkcore.Request(ctx, apiReq, r.service.config, options...)
   627  	if err != nil {
   628  		return nil, err
   629  	}
   630  	// 反序列响应结果
   631  	resp := &GetByApplicationReferralResp{ApiResp: apiResp}
   632  	err = apiResp.JSONUnmarshalBody(resp)
   633  	if err != nil {
   634  		return nil, err
   635  	}
   636  	return resp, err
   637  }
   638  
   639  // 获取简历来源列表
   640  //
   641  // - 获取简历来源列表
   642  //
   643  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/resume_source/list
   644  //
   645  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/list_resumeSource.go
   646  func (r *resumeSource) List(ctx context.Context, req *ListResumeSourceReq, options ...larkcore.RequestOptionFunc) (*ListResumeSourceResp, error) {
   647  	// 发起请求
   648  	apiReq := req.apiReq
   649  	apiReq.ApiPath = "/open-apis/hire/v1/resume_sources"
   650  	apiReq.HttpMethod = http.MethodGet
   651  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   652  	apiResp, err := larkcore.Request(ctx, apiReq, r.service.config, options...)
   653  	if err != nil {
   654  		return nil, err
   655  	}
   656  	// 反序列响应结果
   657  	resp := &ListResumeSourceResp{ApiResp: apiResp}
   658  	err = apiResp.JSONUnmarshalBody(resp)
   659  	if err != nil {
   660  		return nil, err
   661  	}
   662  	return resp, err
   663  }
   664  func (r *resumeSource) ListByIterator(ctx context.Context, req *ListResumeSourceReq, options ...larkcore.RequestOptionFunc) (*ListResumeSourceIterator, error) {
   665  	return &ListResumeSourceIterator{
   666  		ctx:      ctx,
   667  		req:      req,
   668  		listFunc: r.List,
   669  		options:  options,
   670  		limit:    req.Limit}, nil
   671  }
   672  
   673  // 获取人才信息
   674  //
   675  // - 根据人才 ID 获取人才信息
   676  //
   677  // - 官网API文档链接:https://open.feishu.cn/document/ukTMukTMukTM/uUzM1YjL1MTN24SNzUjN/get-talent
   678  //
   679  // - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/hirev1/get_talent.go
   680  func (t *talent) Get(ctx context.Context, req *GetTalentReq, options ...larkcore.RequestOptionFunc) (*GetTalentResp, error) {
   681  	// 发起请求
   682  	apiReq := req.apiReq
   683  	apiReq.ApiPath = "/open-apis/hire/v1/talents/:talent_id"
   684  	apiReq.HttpMethod = http.MethodGet
   685  	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
   686  	apiResp, err := larkcore.Request(ctx, apiReq, t.service.config, options...)
   687  	if err != nil {
   688  		return nil, err
   689  	}
   690  	// 反序列响应结果
   691  	resp := &GetTalentResp{ApiResp: apiResp}
   692  	err = apiResp.JSONUnmarshalBody(resp)
   693  	if err != nil {
   694  		return nil, err
   695  	}
   696  	return resp, err
   697  }