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

// GetHireOfferSchema 根据 Offer 申请表 ID, 获取 Offer 申请表的详细信息
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer_schema/get
// new doc: https://open.feishu.cn/document/server-docs/historic-version/hire_internal/offer/get
//
// Deprecated
func (r *HireService) GetHireOfferSchema(ctx context.Context, request *GetHireOfferSchemaReq, options ...MethodOptionFunc) (*GetHireOfferSchemaResp, *Response, error) {
	if r.cli.mock.mockHireGetHireOfferSchema != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Hire#GetHireOfferSchema mock enable")
		return r.cli.mock.mockHireGetHireOfferSchema(ctx, request, options...)
	}

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

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

// MockHireGetHireOfferSchema mock HireGetHireOfferSchema method
func (r *Mock) MockHireGetHireOfferSchema(f func(ctx context.Context, request *GetHireOfferSchemaReq, options ...MethodOptionFunc) (*GetHireOfferSchemaResp, *Response, error)) {
	r.mockHireGetHireOfferSchema = f
}

// UnMockHireGetHireOfferSchema un-mock HireGetHireOfferSchema method
func (r *Mock) UnMockHireGetHireOfferSchema() {
	r.mockHireGetHireOfferSchema = nil
}

// GetHireOfferSchemaReq ...
type GetHireOfferSchemaReq struct {
	OfferSchemaID string `path:"offer_schema_id" json:"-"` // offer申请表的ID *必需属性, 示例值: "1231231231231"
}

// GetHireOfferSchemaResp ...
type GetHireOfferSchemaResp struct {
	ID         string                          `json:"id,omitempty"`          // offer申请表ID
	Scenario   int64                           `json:"scenario,omitempty"`    // offer申请表使用场景, 可选值有: `1`: Offer审批表
	Version    int64                           `json:"version,omitempty"`     // 申请表版本
	ObjectList []*GetHireOfferSchemaRespObject `json:"object_list,omitempty"` // 字段对象信息
}

// GetHireOfferSchemaRespObject ...
type GetHireOfferSchemaRespObject struct {
	ID           string                                `json:"id,omitempty"`            // 字段ID
	Name         *GetHireOfferSchemaRespObjectName     `json:"name,omitempty"`          // 字段名称
	Type         string                                `json:"type,omitempty"`          // 字段类型, text=单行文本, long_text=多行文本, select=单选, multi_select=多选, date_select=日期, number=数字
	IsCustomized bool                                  `json:"is_customized,omitempty"` // 字段是否为自定义
	OptionList   []*GetHireOfferSchemaRespObjectOption `json:"option_list,omitempty"`   // 单选/多选可选择字段的选项值
}

// GetHireOfferSchemaRespObjectName ...
type GetHireOfferSchemaRespObjectName struct {
	ZhCn string `json:"zh_cn,omitempty"` // 中文名
	EnUs string `json:"en_us,omitempty"` // 英文名
}

// GetHireOfferSchemaRespObjectOption ...
type GetHireOfferSchemaRespObjectOption struct {
	Name         *GetHireOfferSchemaRespObjectOptionName `json:"name,omitempty"`          // 名字
	Index        int64                                   `json:"index,omitempty"`         // 选项序号
	ActiveStatus int64                                   `json:"active_status,omitempty"` // 选项当前是否启用, 可选值有: `1`: 进行中, `2`: 已终止
}

// GetHireOfferSchemaRespObjectOptionName ...
type GetHireOfferSchemaRespObjectOptionName struct {
	ZhCn string `json:"zh_cn,omitempty"` // 中文名
	EnUs string `json:"en_us,omitempty"` // 英文名
}

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