/
AlibabaEinvoiceMerchantBindcompanyAPIRequest.go
174 lines (149 loc) · 5.91 KB
/
AlibabaEinvoiceMerchantBindcompanyAPIRequest.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
package einvoice
import (
"net/url"
"sync"
"github.com/bububa/opentaobao/model"
)
// AlibabaEinvoiceMerchantBindcompanyAPIRequest 发票中台-跨平台绑定已入驻税号与商户 API请求
// alibaba.einvoice.merchant.bindcompany
//
// 税号在阿里发票平台入驻成功后,允许业务方通过本接口跨业务平台绑定入驻税号和业务平台商户,绑定成功后该商户可以使用该税号的盘进行开票。绑定成功后,可以使用同平台授权、取消授权税号适用商户接口来变更税号和商户关系。
type AlibabaEinvoiceMerchantBindcompanyAPIRequest struct {
model.Params
// 业务方发起首次绑定门店的唯一幂等ID, 由业务方生成。只能由字母和数字组成。
_outerId string
// 业务平台商户ID
_merchantUserId string
// 激活码
_activationCode string
// 业务平台code, 由阿里发票分配
_platformCode string
// 税务登记号
_payeeRegisterNo string
// 业务平台门店名称
_merchantName string
// 税号已入驻的原业务平台code
_sourcePlatformCode string
}
// NewAlibabaEinvoiceMerchantBindcompanyRequest 初始化AlibabaEinvoiceMerchantBindcompanyAPIRequest对象
func NewAlibabaEinvoiceMerchantBindcompanyRequest() *AlibabaEinvoiceMerchantBindcompanyAPIRequest {
return &AlibabaEinvoiceMerchantBindcompanyAPIRequest{
Params: model.NewParams(7),
}
}
// Reset IRequest interface 方法, 清空结构体
func (r *AlibabaEinvoiceMerchantBindcompanyAPIRequest) Reset() {
r._outerId = ""
r._merchantUserId = ""
r._activationCode = ""
r._platformCode = ""
r._payeeRegisterNo = ""
r._merchantName = ""
r._sourcePlatformCode = ""
r.Params.ToZero()
}
// GetApiMethodName IRequest interface 方法, 获取Api method
func (r AlibabaEinvoiceMerchantBindcompanyAPIRequest) GetApiMethodName() string {
return "alibaba.einvoice.merchant.bindcompany"
}
// GetApiParams IRequest interface 方法, 获取API参数
func (r AlibabaEinvoiceMerchantBindcompanyAPIRequest) GetApiParams(params url.Values) {
for k, v := range r.Params {
params.Set(k, v.String())
}
}
// GetRawParams IRequest interface 方法, 获取API原始参数
func (r AlibabaEinvoiceMerchantBindcompanyAPIRequest) GetRawParams() model.Params {
return r.Params
}
// SetOuterId is OuterId Setter
// 业务方发起首次绑定门店的唯一幂等ID, 由业务方生成。只能由字母和数字组成。
func (r *AlibabaEinvoiceMerchantBindcompanyAPIRequest) SetOuterId(_outerId string) error {
r._outerId = _outerId
r.Set("outer_id", _outerId)
return nil
}
// GetOuterId OuterId Getter
func (r AlibabaEinvoiceMerchantBindcompanyAPIRequest) GetOuterId() string {
return r._outerId
}
// SetMerchantUserId is MerchantUserId Setter
// 业务平台商户ID
func (r *AlibabaEinvoiceMerchantBindcompanyAPIRequest) SetMerchantUserId(_merchantUserId string) error {
r._merchantUserId = _merchantUserId
r.Set("merchant_user_id", _merchantUserId)
return nil
}
// GetMerchantUserId MerchantUserId Getter
func (r AlibabaEinvoiceMerchantBindcompanyAPIRequest) GetMerchantUserId() string {
return r._merchantUserId
}
// SetActivationCode is ActivationCode Setter
// 激活码
func (r *AlibabaEinvoiceMerchantBindcompanyAPIRequest) SetActivationCode(_activationCode string) error {
r._activationCode = _activationCode
r.Set("activation_code", _activationCode)
return nil
}
// GetActivationCode ActivationCode Getter
func (r AlibabaEinvoiceMerchantBindcompanyAPIRequest) GetActivationCode() string {
return r._activationCode
}
// SetPlatformCode is PlatformCode Setter
// 业务平台code, 由阿里发票分配
func (r *AlibabaEinvoiceMerchantBindcompanyAPIRequest) SetPlatformCode(_platformCode string) error {
r._platformCode = _platformCode
r.Set("platform_code", _platformCode)
return nil
}
// GetPlatformCode PlatformCode Getter
func (r AlibabaEinvoiceMerchantBindcompanyAPIRequest) GetPlatformCode() string {
return r._platformCode
}
// SetPayeeRegisterNo is PayeeRegisterNo Setter
// 税务登记号
func (r *AlibabaEinvoiceMerchantBindcompanyAPIRequest) SetPayeeRegisterNo(_payeeRegisterNo string) error {
r._payeeRegisterNo = _payeeRegisterNo
r.Set("payee_register_no", _payeeRegisterNo)
return nil
}
// GetPayeeRegisterNo PayeeRegisterNo Getter
func (r AlibabaEinvoiceMerchantBindcompanyAPIRequest) GetPayeeRegisterNo() string {
return r._payeeRegisterNo
}
// SetMerchantName is MerchantName Setter
// 业务平台门店名称
func (r *AlibabaEinvoiceMerchantBindcompanyAPIRequest) SetMerchantName(_merchantName string) error {
r._merchantName = _merchantName
r.Set("merchant_name", _merchantName)
return nil
}
// GetMerchantName MerchantName Getter
func (r AlibabaEinvoiceMerchantBindcompanyAPIRequest) GetMerchantName() string {
return r._merchantName
}
// SetSourcePlatformCode is SourcePlatformCode Setter
// 税号已入驻的原业务平台code
func (r *AlibabaEinvoiceMerchantBindcompanyAPIRequest) SetSourcePlatformCode(_sourcePlatformCode string) error {
r._sourcePlatformCode = _sourcePlatformCode
r.Set("source_platform_code", _sourcePlatformCode)
return nil
}
// GetSourcePlatformCode SourcePlatformCode Getter
func (r AlibabaEinvoiceMerchantBindcompanyAPIRequest) GetSourcePlatformCode() string {
return r._sourcePlatformCode
}
var poolAlibabaEinvoiceMerchantBindcompanyAPIRequest = sync.Pool{
New: func() any {
return NewAlibabaEinvoiceMerchantBindcompanyRequest()
},
}
// GetAlibabaEinvoiceMerchantBindcompanyRequest 从 sync.Pool 获取 AlibabaEinvoiceMerchantBindcompanyAPIRequest
func GetAlibabaEinvoiceMerchantBindcompanyAPIRequest() *AlibabaEinvoiceMerchantBindcompanyAPIRequest {
return poolAlibabaEinvoiceMerchantBindcompanyAPIRequest.Get().(*AlibabaEinvoiceMerchantBindcompanyAPIRequest)
}
// ReleaseAlibabaEinvoiceMerchantBindcompanyAPIRequest 将 AlibabaEinvoiceMerchantBindcompanyAPIRequest 放入 sync.Pool
func ReleaseAlibabaEinvoiceMerchantBindcompanyAPIRequest(v *AlibabaEinvoiceMerchantBindcompanyAPIRequest) {
v.Reset()
poolAlibabaEinvoiceMerchantBindcompanyAPIRequest.Put(v)
}