-
Notifications
You must be signed in to change notification settings - Fork 271
/
batch_insert_items.go
178 lines (168 loc) · 7.28 KB
/
batch_insert_items.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
175
176
177
178
package cloudesl
//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.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)
// BatchInsertItems invokes the cloudesl.BatchInsertItems API synchronously
func (client *Client) BatchInsertItems(request *BatchInsertItemsRequest) (response *BatchInsertItemsResponse, err error) {
response = CreateBatchInsertItemsResponse()
err = client.DoAction(request, response)
return
}
// BatchInsertItemsWithChan invokes the cloudesl.BatchInsertItems API asynchronously
func (client *Client) BatchInsertItemsWithChan(request *BatchInsertItemsRequest) (<-chan *BatchInsertItemsResponse, <-chan error) {
responseChan := make(chan *BatchInsertItemsResponse, 1)
errChan := make(chan error, 1)
err := client.AddAsyncTask(func() {
defer close(responseChan)
defer close(errChan)
response, err := client.BatchInsertItems(request)
if err != nil {
errChan <- err
} else {
responseChan <- response
}
})
if err != nil {
errChan <- err
close(responseChan)
close(errChan)
}
return responseChan, errChan
}
// BatchInsertItemsWithCallback invokes the cloudesl.BatchInsertItems API asynchronously
func (client *Client) BatchInsertItemsWithCallback(request *BatchInsertItemsRequest, callback func(response *BatchInsertItemsResponse, err error)) <-chan int {
result := make(chan int, 1)
err := client.AddAsyncTask(func() {
var response *BatchInsertItemsResponse
var err error
defer close(result)
response, err = client.BatchInsertItems(request)
callback(response, err)
result <- 1
})
if err != nil {
defer close(result)
callback(nil, err)
result <- 0
}
return result
}
// BatchInsertItemsRequest is the request struct for api BatchInsertItems
type BatchInsertItemsRequest struct {
*requests.RpcRequest
ExtraParams string `position:"Body" name:"ExtraParams"`
StoreId string `position:"Body" name:"StoreId"`
SyncByItemId requests.Boolean `position:"Body" name:"SyncByItemId"`
ItemInfo *[]BatchInsertItemsItemInfo `position:"Body" name:"ItemInfo" type:"Repeated"`
}
// BatchInsertItemsItemInfo is a repeated param struct in BatchInsertItemsRequest
type BatchInsertItemsItemInfo struct {
MemberPrice string `name:"MemberPrice"`
ActionPrice string `name:"ActionPrice"`
BeSourceCode string `name:"BeSourceCode"`
BrandName string `name:"BrandName"`
PromotionStart string `name:"PromotionStart"`
PriceUnit string `name:"PriceUnit"`
Rank string `name:"Rank"`
ItemInfoIndex string `name:"ItemInfoIndex"`
ItemBarCode string `name:"ItemBarCode"`
CustomizeFeatureK string `name:"CustomizeFeatureK"`
CustomizeFeatureL string `name:"CustomizeFeatureL"`
CustomizeFeatureM string `name:"CustomizeFeatureM"`
CustomizeFeatureN string `name:"CustomizeFeatureN"`
BePromotion string `name:"BePromotion"`
CustomizeFeatureO string `name:"CustomizeFeatureO"`
CustomizeFeatureP string `name:"CustomizeFeatureP"`
PromotionEnd string `name:"PromotionEnd"`
ItemTitle string `name:"ItemTitle"`
CustomizeFeatureQ string `name:"CustomizeFeatureQ"`
CustomizeFeatureR string `name:"CustomizeFeatureR"`
CustomizeFeatureC string `name:"CustomizeFeatureC"`
CustomizeFeatureD string `name:"CustomizeFeatureD"`
ItemQrCode string `name:"ItemQrCode"`
CustomizeFeatureE string `name:"CustomizeFeatureE"`
PromotionReason string `name:"PromotionReason"`
InventoryStatus string `name:"InventoryStatus"`
CustomizeFeatureF string `name:"CustomizeFeatureF"`
CustomizeFeatureG string `name:"CustomizeFeatureG"`
CustomizeFeatureH string `name:"CustomizeFeatureH"`
CustomizeFeatureI string `name:"CustomizeFeatureI"`
CustomizeFeatureJ string `name:"CustomizeFeatureJ"`
CustomizeFeatureA string `name:"CustomizeFeatureA"`
CustomizeFeatureB string `name:"CustomizeFeatureB"`
SuggestPrice string `name:"SuggestPrice"`
ForestFirstId string `name:"ForestFirstId"`
ProductionPlace string `name:"ProductionPlace"`
SourceCode string `name:"SourceCode"`
Manufacturer string `name:"Manufacturer"`
ItemId string `name:"ItemId"`
BeMember string `name:"BeMember"`
CustomizeFeatureS string `name:"CustomizeFeatureS"`
CustomizeFeatureT string `name:"CustomizeFeatureT"`
CustomizeFeatureU string `name:"CustomizeFeatureU"`
TemplateSceneId string `name:"TemplateSceneId"`
CustomizeFeatureV string `name:"CustomizeFeatureV"`
CustomizeFeatureW string `name:"CustomizeFeatureW"`
CustomizeFeatureX string `name:"CustomizeFeatureX"`
CustomizeFeatureY string `name:"CustomizeFeatureY"`
CustomizeFeatureZ string `name:"CustomizeFeatureZ"`
SalesPrice string `name:"SalesPrice"`
OriginalPrice string `name:"OriginalPrice"`
ItemShortTitle string `name:"ItemShortTitle"`
ItemPicUrl string `name:"ItemPicUrl"`
ForestSecondId string `name:"ForestSecondId"`
SupplierName string `name:"SupplierName"`
BeClearance string `name:"BeClearance"`
Material string `name:"Material"`
ModelNumber string `name:"ModelNumber"`
SaleSpec string `name:"SaleSpec"`
CategoryName string `name:"CategoryName"`
TaxFee string `name:"TaxFee"`
EnergyEfficiency string `name:"EnergyEfficiency"`
PromotionText string `name:"PromotionText"`
SkuId string `name:"SkuId"`
}
// BatchInsertItemsResponse is the response struct for api BatchInsertItems
type BatchInsertItemsResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
ErrorMessage string `json:"ErrorMessage" xml:"ErrorMessage"`
Success bool `json:"Success" xml:"Success"`
ErrorCode string `json:"ErrorCode" xml:"ErrorCode"`
Code string `json:"Code" xml:"Code"`
Message string `json:"Message" xml:"Message"`
DynamicMessage string `json:"DynamicMessage" xml:"DynamicMessage"`
DynamicCode string `json:"DynamicCode" xml:"DynamicCode"`
BatchResults []BatchResult `json:"BatchResults" xml:"BatchResults"`
}
// CreateBatchInsertItemsRequest creates a request to invoke BatchInsertItems API
func CreateBatchInsertItemsRequest() (request *BatchInsertItemsRequest) {
request = &BatchInsertItemsRequest{
RpcRequest: &requests.RpcRequest{},
}
request.InitWithApiInfo("cloudesl", "2020-02-01", "BatchInsertItems", "", "")
request.Method = requests.POST
return
}
// CreateBatchInsertItemsResponse creates a response to parse from BatchInsertItems response
func CreateBatchInsertItemsResponse() (response *BatchInsertItemsResponse) {
response = &BatchInsertItemsResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}