-
Notifications
You must be signed in to change notification settings - Fork 45
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
8 changed files
with
203 additions
and
2 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,23 @@ | ||
package eventmanager | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/eventmanager" | ||
) | ||
|
||
// AllAssetsDetail 获取已创建资产详情(新) | ||
// - 本接口为巨量引擎开放平台2024年6月5日新增接口,接口能力覆盖旧接口「获取已创建资产列表」,且新增支持以下能力: | ||
// - 支持获取橙子落地页TETRIS_EXTERNAL、应用APP类型的资产详情信息 | ||
// - 可通过资产ID筛选查询资产详情 | ||
// | ||
// - 「获取已创建资产列表」接口即将于8月6日下线,可切换至本接口获取资产详情 | ||
// - 应答参数返回的资产范围如下: | ||
// - 仅支持查询账户下创建以及共享中状态、未删除的资产详情,共享失败的资产不支持查询 | ||
// - 账户下不返回已删除资产的资产详情信息 | ||
func AllAssetsDetail(clt *core.SDKClient, accessToken string, req *eventmanager.AllAssetsDetailRequest) ([]eventmanager.AssetDetail, error) { | ||
var resp eventmanager.AllAssetsDetailResponse | ||
if err := clt.Get("2/tools/event/all_assets/detail/", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data.List, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package eventmanager | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/eventmanager" | ||
) | ||
|
||
// AllAssetsList 获取账户下资产列表(新) | ||
// - 本接口为巨量引擎开放平台2024年6月5日新增接口,接口能力覆盖旧接口「获取已创建资产列表」,且新增支持以下能力: | ||
// - 支持获取橙子落地页TETRIS_EXTERNAL、应用APP资产类型信息 | ||
// - 可通过资产ID、资产类型以及资产修改时间筛选查询广告主拥有的资产信息 | ||
// | ||
// - 「获取已创建资产列表」接口即将于8月6日下线,可切换至本接口获取资产信息 | ||
// - 应答参数返回的资产范围如下: | ||
// - 包含账户下创建的资产以及被共享的资产,返回结果与巨量广告平台事件资产列表&详情信息一致 | ||
// - 账户下不返回已删除的资产 | ||
func AllAssetsList(clt *core.SDKClient, accessToken string, req *eventmanager.AllAssetsListRequest) (*eventmanager.AllAssetsListResult, error) { | ||
var resp eventmanager.AllAssetsListResponse | ||
if err := clt.Get("2/tools/event/all_assets/list/", 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package enum | ||
|
||
// AssetShareType 资产来源 | ||
type AssetShareType string | ||
|
||
const ( | ||
// AssetShareType_MY_CREATIONS 我创建的 | ||
AssetShareType_MY_CREATIONS AssetShareType = "MY_CREATIONS" | ||
// AssetShareType_SHARING 共享中 | ||
AssetShareType_SHARING AssetShareType = "SHARING" | ||
// AssetShareType_SHATE_EXPIRED 共享失效 | ||
AssetShareType_SHATE_EXPIRED AssetShareType = "SHATE_EXPIRED" | ||
) |
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,36 @@ | ||
package eventmanager | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/model" | ||
"github.com/bububa/oceanengine/marketing-api/util" | ||
) | ||
|
||
// AllAssetsDetailRequest 获取已创建资产详情(新) API Request | ||
type AllAssetsDetailRequest struct { | ||
// AdvertiserID 广告主 id | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// AssetIDs 资产id列表,list长度最长50 | ||
// 当账户下不存在该资产id时不会返回详情信息;当资产共享失效时,不会返回详情信息。 | ||
AssetIDs []uint64 `json:"asset_ids,omitempty"` | ||
} | ||
|
||
// Encode implements GetRequest interface | ||
func (r AllAssetsDetailRequest) Encode() string { | ||
values := util.GetUrlValues() | ||
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) | ||
values.Set("asset_ids", string(util.JSONMarshal(r.AssetIDs))) | ||
ret := values.Encode() | ||
util.PutUrlValues(values) | ||
return ret | ||
} | ||
|
||
// AllAssetsDetailResponse 获取已创建资产详情(新) API Response | ||
type AllAssetsDetailResponse struct { | ||
model.BaseResponse | ||
Data struct { | ||
// List 资产列表 | ||
List []AssetDetail `json:"list,omitempty"` | ||
} `json:"data,omitempty"` | ||
} |
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,65 @@ | ||
package eventmanager | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/enum" | ||
"github.com/bububa/oceanengine/marketing-api/model" | ||
"github.com/bububa/oceanengine/marketing-api/util" | ||
) | ||
|
||
// AllAssetsListRequest 获取账户下资产列表(新) API Request | ||
type AllAssetsListRequest struct { | ||
// AdvertiserID 广告主ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// Filtering 过滤条件 | ||
Filtering *AllAssetsListFilter `json:"filtering,omitempty"` | ||
// Page 页数,默认值`1`,最大值`999999` | ||
Page int `json:"page,omitempty"` | ||
// PageSize 页面大小,默认值`10`,最大值`100` | ||
PageSize int `json:"page_size,omitempty"` | ||
} | ||
|
||
type AllAssetsListFilter struct { | ||
// AssetIDs 资产id列表,list长度最大`100` | ||
AssetIDs []uint64 `json:"asset_ids,omitempty"` | ||
// AssetType 资产类型 | ||
AssetType enum.AssetType `json:"asset_types,omitempty"` | ||
// ModifyStartTime 按照资产修改时间筛选,开始时间`YYYY-MM-DD`,必须与结束时间搭配传入 | ||
// 开始时间必须≤结束时间 | ||
ModifyStartTime string `json:"modify_start_time,omitempty"` | ||
// ModifyEndTime 按照资产修改时间筛选,结束时间`YYYY-MM-DD`,必须与开始时间搭配传入 | ||
// 开始时间必须≤结束时间 | ||
ModifyEndTime string `json:"modify_end_time,omitempty"` | ||
} | ||
|
||
// Encode implements GetRequest interface | ||
func (r AllAssetsListRequest) Encode() string { | ||
values := util.GetUrlValues() | ||
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) | ||
if r.Filtering != nil { | ||
values.Set("filtering", string(util.JSONMarshal(r.Filtering))) | ||
} | ||
if r.Page > 0 { | ||
values.Set("page", strconv.Itoa(r.Page)) | ||
} | ||
if r.PageSize > 0 { | ||
values.Set("page_size", strconv.Itoa(r.PageSize)) | ||
} | ||
ret := values.Encode() | ||
util.PutUrlValues(values) | ||
return ret | ||
} | ||
|
||
// AllAssetsListResponse 获取账户下资产列表(新) API Response | ||
type AllAssetsListResponse struct { | ||
model.BaseResponse | ||
Data *AllAssetsListResult `json:"data,omitempty"` | ||
} | ||
|
||
type AllAssetsListResult struct { | ||
// PageInfo 分页信息 | ||
PageInfo *model.PageInfo `json:"page_info,omitempty"` | ||
// List 资产列表 | ||
List []AssetBaseInfo `json:"list,omitempty"` | ||
} |
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