-
-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathapi_corehr_currency_get.go
92 lines (80 loc) · 3.8 KB
/
api_corehr_currency_get.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// 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"
)
// GetCoreHRCurrency 查询单个货币信息。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/currency/get
// new doc: https://open.feishu.cn/document/server-docs/corehr-v1/basic-infomation/currency/get
//
// Deprecated
func (r *CoreHRService) GetCoreHRCurrency(ctx context.Context, request *GetCoreHRCurrencyReq, options ...MethodOptionFunc) (*GetCoreHRCurrencyResp, *Response, error) {
if r.cli.mock.mockCoreHRGetCoreHRCurrency != nil {
r.cli.Log(ctx, LogLevelDebug, "[lark] CoreHR#GetCoreHRCurrency mock enable")
return r.cli.mock.mockCoreHRGetCoreHRCurrency(ctx, request, options...)
}
req := &RawRequestReq{
Scope: "CoreHR",
API: "GetCoreHRCurrency",
Method: "GET",
URL: r.cli.openBaseURL + "/open-apis/corehr/v1/currencies/:currency_id",
Body: request,
MethodOption: newMethodOption(options),
NeedTenantAccessToken: true,
}
resp := new(getCoreHRCurrencyResp)
response, err := r.cli.RawRequest(ctx, req, resp)
return resp.Data, response, err
}
// MockCoreHRGetCoreHRCurrency mock CoreHRGetCoreHRCurrency method
func (r *Mock) MockCoreHRGetCoreHRCurrency(f func(ctx context.Context, request *GetCoreHRCurrencyReq, options ...MethodOptionFunc) (*GetCoreHRCurrencyResp, *Response, error)) {
r.mockCoreHRGetCoreHRCurrency = f
}
// UnMockCoreHRGetCoreHRCurrency un-mock CoreHRGetCoreHRCurrency method
func (r *Mock) UnMockCoreHRGetCoreHRCurrency() {
r.mockCoreHRGetCoreHRCurrency = nil
}
// GetCoreHRCurrencyReq ...
type GetCoreHRCurrencyReq struct {
CurrencyID string `path:"currency_id" json:"-"` // 货币 ID, 示例值: "67489937334909845"
}
// GetCoreHRCurrencyResp ...
type GetCoreHRCurrencyResp struct {
Currency *GetCoreHRCurrencyRespCurrency `json:"currency,omitempty"` // 货币信息
}
// GetCoreHRCurrencyRespCurrency ...
type GetCoreHRCurrencyRespCurrency struct {
ID string `json:"id,omitempty"` // 货币id
CountryRegionID string `json:"country_region_id,omitempty"` // 货币所属国家/地区id, 详细信息可通过[查询国家/地区信息]接口查询获得
CurrencyName []*GetCoreHRCurrencyRespCurrencyCurrencyName `json:"currency_name,omitempty"` // 货币名称
NumericCode int64 `json:"numeric_code,omitempty"` // 数字代码
CurrencyAlpha3Code string `json:"currency_alpha_3_code,omitempty"` // 三位字母代码
}
// GetCoreHRCurrencyRespCurrencyCurrencyName ...
type GetCoreHRCurrencyRespCurrencyCurrencyName struct {
Lang string `json:"lang,omitempty"` // 名称信息的语言
Value string `json:"value,omitempty"` // 名称信息的内容
}
// getCoreHRCurrencyResp ...
type getCoreHRCurrencyResp struct {
Code int64 `json:"code,omitempty"` // 错误码, 非 0 表示失败
Msg string `json:"msg,omitempty"` // 错误描述
Data *GetCoreHRCurrencyResp `json:"data,omitempty"`
Error *ErrorDetail `json:"error,omitempty"`
}