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

// TransformApprovalUserID 用于灰度租户内的 userID 相互转换。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uEDN5UjLxQTO14SM0kTN
// new doc: https://open.feishu.cn/document/server-docs/approval-v4/approval-search/search-approval-id-(dedicated)
func (r *ApprovalService) TransformApprovalUserID(ctx context.Context, request *TransformApprovalUserIDReq, options ...MethodOptionFunc) (*TransformApprovalUserIDResp, *Response, error) {
	if r.cli.mock.mockApprovalTransformApprovalUserID != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Approval#TransformApprovalUserID mock enable")
		return r.cli.mock.mockApprovalTransformApprovalUserID(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "Approval",
		API:                   "TransformApprovalUserID",
		Method:                "POST",
		URL:                   r.cli.wwwBaseURL + "/approval/openapi/v1/id/get",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
	}
	resp := new(transformApprovalUserIDResp)

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

// MockApprovalTransformApprovalUserID mock ApprovalTransformApprovalUserID method
func (r *Mock) MockApprovalTransformApprovalUserID(f func(ctx context.Context, request *TransformApprovalUserIDReq, options ...MethodOptionFunc) (*TransformApprovalUserIDResp, *Response, error)) {
	r.mockApprovalTransformApprovalUserID = f
}

// UnMockApprovalTransformApprovalUserID un-mock ApprovalTransformApprovalUserID method
func (r *Mock) UnMockApprovalTransformApprovalUserID() {
	r.mockApprovalTransformApprovalUserID = nil
}

// TransformApprovalUserIDReq ...
type TransformApprovalUserIDReq struct {
	TenantKey  *string  `json:"tenant_key,omitempty"`   // 企业标识（user_id_list 不为空时必须）
	UserIDList []string `json:"user_id_list,omitempty"` // Employee ID 数组（最大100个）
	LarkIDList []int64  `json:"lark_id_list,omitempty"` // Lark User ID 数组（最大100个）
}

// TransformApprovalUserIDResp ...
type TransformApprovalUserIDResp struct {
}

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