// 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"
)

// DeleteHireExternalApplication 将外部投递删除
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/external_application/delete
// new doc: https://open.feishu.cn/document/server-docs/hire-v1/get-candidates/import-external-system-information/delete
func (r *HireService) DeleteHireExternalApplication(ctx context.Context, request *DeleteHireExternalApplicationReq, options ...MethodOptionFunc) (*DeleteHireExternalApplicationResp, *Response, error) {
	if r.cli.mock.mockHireDeleteHireExternalApplication != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Hire#DeleteHireExternalApplication mock enable")
		return r.cli.mock.mockHireDeleteHireExternalApplication(ctx, request, options...)
	}

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

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

// MockHireDeleteHireExternalApplication mock HireDeleteHireExternalApplication method
func (r *Mock) MockHireDeleteHireExternalApplication(f func(ctx context.Context, request *DeleteHireExternalApplicationReq, options ...MethodOptionFunc) (*DeleteHireExternalApplicationResp, *Response, error)) {
	r.mockHireDeleteHireExternalApplication = f
}

// UnMockHireDeleteHireExternalApplication un-mock HireDeleteHireExternalApplication method
func (r *Mock) UnMockHireDeleteHireExternalApplication() {
	r.mockHireDeleteHireExternalApplication = nil
}

// DeleteHireExternalApplicationReq ...
type DeleteHireExternalApplicationReq struct {
	ExternalApplicationID string  `path:"external_application_id" json:"-"` // 外部投递 id, 示例值: "6960663240925956660"
	TalentID              *string `query:"talent_id" json:"-"`              // 人才ID, 示例值: 6960663240925956660
}

// DeleteHireExternalApplicationResp ...
type DeleteHireExternalApplicationResp struct {
	ExternalApplication *DeleteHireExternalApplicationRespExternalApplication `json:"external_application,omitempty"`
}

// DeleteHireExternalApplicationRespExternalApplication ...
type DeleteHireExternalApplicationRespExternalApplication struct {
	ID                 string `json:"id,omitempty"`                   // 外部投递 ID
	JobRecruitmentType int64  `json:"job_recruitment_type,omitempty"` // 职位招聘类型, 可选值有: 1: 社招, 2: 校招
	JobTitle           string `json:"job_title,omitempty"`            // 职位名称
	ResumeSource       string `json:"resume_source,omitempty"`        // 简历来源
	Stage              string `json:"stage,omitempty"`                // 阶段
	TalentID           string `json:"talent_id,omitempty"`            // 人才 ID
	TerminationReason  string `json:"termination_reason,omitempty"`   // 终止原因
	DeliveryType       int64  `json:"delivery_type,omitempty"`        // 投递类型, 可选值有: 1: HR 寻访, 2: 候选人主动投递, 3: 人才推荐, 4: 其他
	ModifyTime         int64  `json:"modify_time,omitempty"`          // 更新时间
	TerminationType    string `json:"termination_type,omitempty"`     // 终止类型
}

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