-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
163 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package dpa | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/dpa" | ||
) | ||
|
||
// ClueProductDelete 删除升级版商品 | ||
// 【使用场景】对广告主创建的「升级版」商品进行删除操作,注意已经关联计划的商品不允许进行删除,支持批量,一次性调用最大个数为100,服务为部分成功部分失败。 | ||
func ClueProductDelete(ctx context.Context, clt *core.SDKClient, accessToken string, req *dpa.ClueProductDeleteRequest) (*dpa.ClueProductDeleteResult, error) { | ||
var resp dpa.ClueProductDeleteResponse | ||
if err := clt.PostAPI(ctx, "2/dpa/clue_product/delete/", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package enum | ||
|
||
// AwemeAuthShareType 授权共享类型 | ||
type AwemeAuthShareType = string | ||
|
||
const ( | ||
// AwemeAuthShareType_SHARE_BY_ONESELF 广告账户自主授权 | ||
AwemeAuthShareType_SHARE_BY_ONESELF AwemeAuthShareType = "SHARE_BY_ONESELF" | ||
// AwemeAuthShareType_SHARE_BY_SAME_ENTITY 客户共享授权 | ||
AwemeAuthShareType_SHARE_BY_SAME_ENTITY AwemeAuthShareType = "SHARE_BY_SAME_ENTITY" | ||
// AwemeAuthShareType_SHARE_FROM_BP 组织共享授权 | ||
AwemeAuthShareType_SHARE_FROM_BP AwemeAuthShareType = "SHARE_FROM_BP" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package dpa | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/model" | ||
"github.com/bububa/oceanengine/marketing-api/util" | ||
) | ||
|
||
// ClueProductDeleteRequest 删除升级版商品 API Request | ||
type ClueProductDeleteRequest struct { | ||
// AdvertiserID 广告主ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// ProductIDs 通过巨量商品id删除,支持批量,一次请求最多允许传入100 | ||
ProductIDs uint64 `json:"product_ids,omitempty"` | ||
// StoreIDAndOuterID 电商店铺商品(category_id为140000000时)支持按照店铺id+外部商品id删除,其他类目商品不需要传 | ||
StoreIDAndOuterID *StoreIDAndOuterID `json:"store_id_and_outer_id,omitempty"` | ||
} | ||
|
||
// StoreIDAndOuterID 电商店铺商品 | ||
type StoreIDAndOuterID struct { | ||
// StoreID 店铺ID,传入时必须与商品外部ID同时传入 | ||
StoreID string `json:"store_id,omitempty"` | ||
// OuterID 商品外部ID | ||
OuterID string `json:"outer_id,omitempty"` | ||
} | ||
|
||
// Encode implements PostRequest interface | ||
func (r ClueProductDeleteRequest) Encode() []byte { | ||
return util.JSONMarshal(r) | ||
} | ||
|
||
// ClueProductDeleteResponse 删除升级版商品 API Request | ||
type ClueProductDeleteResponse struct { | ||
model.BaseResponse | ||
Data *ClueProductDeleteResult `json:"data,omitempty"` | ||
} | ||
|
||
type ClueProductDeleteResult struct { | ||
// ProductIDs 删除成功的商品ID集合 | ||
ProductIDs []uint64 `json:"product_ids,omitempty"` | ||
// Errors 删除失败的商品ID集合及错误信息 | ||
Errors []ClueProductDeleteError `json:"errors,omitempty"` | ||
} | ||
|
||
// Error 删除失败的商品ID集合及错误信息 | ||
type ClueProductDeleteError struct { | ||
// ProductID 商品ID | ||
ProductID uint64 `json:"product_id,omitempty"` | ||
// ErrorMessage 错误信息(主要的可能错误为商品关联了在投计划) | ||
ErrorMessage string `json:"error_message,omitempty"` | ||
} | ||
|
||
func (r ClueProductDeleteError) Error() string { | ||
return util.StringsJoin(r.ErrorMessage, "(", strconv.FormatUint(r.ProductID, 10), ")") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters