// Code generated by lark_sdk_gen. DO NOT EDIT.
/**
 * Copyright 2022 chyroc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package lark

import (
	"context"
)

// GetHireApplicationList 根据限定条件获取投递列表信息。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/application/list
// new doc: https://open.feishu.cn/document/server-docs/hire-v1/candidate-management/delivery-process-management/application/list
func (r *HireService) GetHireApplicationList(ctx context.Context, request *GetHireApplicationListReq, options ...MethodOptionFunc) (*GetHireApplicationListResp, *Response, error) {
	if r.cli.mock.mockHireGetHireApplicationList != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Hire#GetHireApplicationList mock enable")
		return r.cli.mock.mockHireGetHireApplicationList(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "Hire",
		API:                   "GetHireApplicationList",
		Method:                "GET",
		URL:                   r.cli.openBaseURL + "/open-apis/hire/v1/applications",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
	}
	resp := new(getHireApplicationListResp)

	response, err := r.cli.RawRequest(ctx, req, resp)
	return resp.Data, response, err
}

// MockHireGetHireApplicationList mock HireGetHireApplicationList method
func (r *Mock) MockHireGetHireApplicationList(f func(ctx context.Context, request *GetHireApplicationListReq, options ...MethodOptionFunc) (*GetHireApplicationListResp, *Response, error)) {
	r.mockHireGetHireApplicationList = f
}

// UnMockHireGetHireApplicationList un-mock HireGetHireApplicationList method
func (r *Mock) UnMockHireGetHireApplicationList() {
	r.mockHireGetHireApplicationList = nil
}

// GetHireApplicationListReq ...
type GetHireApplicationListReq struct {
	ProcessID       *string `query:"process_id" json:"-"`        // 按流程过滤, 招聘流程 ID, 枚举值通过接口「获取招聘流程信息」接口获取, 示例值: 6960663240925956554
	StageID         *string `query:"stage_id" json:"-"`          // 按招聘阶段过滤, 招聘阶段 ID, 枚举值通过「获取招聘流程信息」接口获取, 示例值: 614218419274131
	TalentID        *string `query:"talent_id" json:"-"`         // 按人才过滤, 示例值: 6891560630172518670
	ActiveStatus    *string `query:"active_status" json:"-"`     // 按活跃状态筛选 1=活跃投递, 2=非活跃投递, 3=全部, 示例值: 1
	JobID           *string `query:"job_id" json:"-"`            // 职位 ID, 示例值: 7334134355464633
	PageToken       *string `query:"page_token" json:"-"`        // 分页标记, 第一次请求不填, 表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token, 下次遍历可采用该 page_token 获取查询结果, 示例值: 1
	PageSize        *int64  `query:"page_size" json:"-"`         // 分页大小, 示例值: 100
	UpdateStartTime *string `query:"update_start_time" json:"-"` // 最早更新时间, 毫秒级时间戳, 示例值: 1618500278663
	UpdateEndTime   *string `query:"update_end_time" json:"-"`   // 最晚更新时间, 毫秒级时间戳, 示例值: 1618500278663
}

// GetHireApplicationListResp ...
type GetHireApplicationListResp struct {
	Items     []string `json:"items,omitempty"`      // 投递ID列表
	PageToken string   `json:"page_token,omitempty"` // 分页标记, 当 has_more 为 true 时, 会同时返回新的 page_token, 否则不返回 page_token
	HasMore   bool     `json:"has_more,omitempty"`   // 是否还有更多项
}

// getHireApplicationListResp ...
type getHireApplicationListResp struct {
	Code  int64                       `json:"code,omitempty"` // 错误码, 非 0 表示失败
	Msg   string                      `json:"msg,omitempty"`  // 错误描述
	Data  *GetHireApplicationListResp `json:"data,omitempty"`
	Error *ErrorDetail                `json:"error,omitempty"`
}
