in linkedmall-20230930/client/client.go [7488:7636]
func (client *Client) SearchProductsWithOptions(request *SearchProductsRequest, headers map[string]*string, runtime *util.RuntimeOptions) (_result *SearchProductsResponse, _err error) {
_err = util.ValidateModel(request)
if _err != nil {
return _result, _err
}
body := map[string]interface{}{}
if !tea.BoolValue(util.IsUnset(request.BrandName)) {
body["brandName"] = request.BrandName
}
if !tea.BoolValue(util.IsUnset(request.CategoryIds)) {
body["categoryIds"] = request.CategoryIds
}
if !tea.BoolValue(util.IsUnset(request.CreateEndTime)) {
body["createEndTime"] = request.CreateEndTime
}
if !tea.BoolValue(util.IsUnset(request.CreateStartTime)) {
body["createStartTime"] = request.CreateStartTime
}
if !tea.BoolValue(util.IsUnset(request.DistributionHighPrice)) {
body["distributionHighPrice"] = request.DistributionHighPrice
}
if !tea.BoolValue(util.IsUnset(request.DistributionHighPriceRatio)) {
body["distributionHighPriceRatio"] = request.DistributionHighPriceRatio
}
if !tea.BoolValue(util.IsUnset(request.DistributionLowPrice)) {
body["distributionLowPrice"] = request.DistributionLowPrice
}
if !tea.BoolValue(util.IsUnset(request.DistributionLowPriceRatio)) {
body["distributionLowPriceRatio"] = request.DistributionLowPriceRatio
}
if !tea.BoolValue(util.IsUnset(request.HighMarkPrice)) {
body["highMarkPrice"] = request.HighMarkPrice
}
if !tea.BoolValue(util.IsUnset(request.HighPrice)) {
body["highPrice"] = request.HighPrice
}
if !tea.BoolValue(util.IsUnset(request.InGroup)) {
body["inGroup"] = request.InGroup
}
if !tea.BoolValue(util.IsUnset(request.InGroupEndTime)) {
body["inGroupEndTime"] = request.InGroupEndTime
}
if !tea.BoolValue(util.IsUnset(request.InGroupStartTime)) {
body["inGroupStartTime"] = request.InGroupStartTime
}
if !tea.BoolValue(util.IsUnset(request.InventoryRiskLevel)) {
body["inventoryRiskLevel"] = request.InventoryRiskLevel
}
if !tea.BoolValue(util.IsUnset(request.LmItemId)) {
body["lmItemId"] = request.LmItemId
}
if !tea.BoolValue(util.IsUnset(request.LowMarkPrice)) {
body["lowMarkPrice"] = request.LowMarkPrice
}
if !tea.BoolValue(util.IsUnset(request.LowPrice)) {
body["lowPrice"] = request.LowPrice
}
if !tea.BoolValue(util.IsUnset(request.ModifyEndTime)) {
body["modifyEndTime"] = request.ModifyEndTime
}
if !tea.BoolValue(util.IsUnset(request.ModifyStartTime)) {
body["modifyStartTime"] = request.ModifyStartTime
}
if !tea.BoolValue(util.IsUnset(request.OrderBy)) {
body["orderBy"] = request.OrderBy
}
if !tea.BoolValue(util.IsUnset(request.OrderDirection)) {
body["orderDirection"] = request.OrderDirection
}
if !tea.BoolValue(util.IsUnset(request.PageNumber)) {
body["pageNumber"] = request.PageNumber
}
if !tea.BoolValue(util.IsUnset(request.PageSize)) {
body["pageSize"] = request.PageSize
}
if !tea.BoolValue(util.IsUnset(request.Platform)) {
body["platform"] = request.Platform
}
if !tea.BoolValue(util.IsUnset(request.ProductId)) {
body["productId"] = request.ProductId
}
if !tea.BoolValue(util.IsUnset(request.ProductName)) {
body["productName"] = request.ProductName
}
if !tea.BoolValue(util.IsUnset(request.ProductStatus)) {
body["productStatus"] = request.ProductStatus
}
if !tea.BoolValue(util.IsUnset(request.PurchaserId)) {
body["purchaserId"] = request.PurchaserId
}
if !tea.BoolValue(util.IsUnset(request.TaxRate)) {
body["taxRate"] = request.TaxRate
}
if !tea.BoolValue(util.IsUnset(request.TradeModeAndCredit)) {
body["tradeModeAndCredit"] = request.TradeModeAndCredit
}
req := &openapi.OpenApiRequest{
Headers: headers,
Body: openapiutil.ParseToMap(body),
}
params := &openapi.Params{
Action: tea.String("SearchProducts"),
Version: tea.String("2023-09-30"),
Protocol: tea.String("HTTPS"),
Pathname: tea.String("/opensaas-s2b/opensaas-s2b-biz-trade/v2/selectionPool/selection-group/product/command/searchProduct"),
Method: tea.String("POST"),
AuthType: tea.String("AK"),
Style: tea.String("ROA"),
ReqBodyType: tea.String("json"),
BodyType: tea.String("json"),
}
_result = &SearchProductsResponse{}
_body, _err := client.CallApi(params, req, runtime)
if _err != nil {
return _result, _err
}
_err = tea.Convert(_body, &_result)
return _result, _err
}