правки

This commit is contained in:
Artem Tsyrulnikov
2026-02-01 14:36:09 +03:00
parent b212b6c22f
commit a92f33c22f
10 changed files with 235 additions and 43 deletions

View File

@@ -634,6 +634,14 @@ type GetPlacementsOutput struct {
Placements []PlacementOutput `json:"placements"`
}
type PlacementsPage struct {
Items []PlacementOutput `json:"items"`
Total int `json:"total"`
Page int `json:"page"`
Size int `json:"size"`
Pages int `json:"pages"`
}
type CreativePreviewOutput struct {
ID string `json:"id"`
Name string `json:"name"`
@@ -687,10 +695,15 @@ func (c *Client) GetPlacements(
jwt string,
workspaceID string,
projectID string,
) (*GetPlacementsOutput, error) {
path := fmt.Sprintf("api/v1/workspaces/%s/projects/%s/placements", workspaceID, projectID)
page, size int,
) (*PlacementsPage, error) {
q := url.Values{}
q.Set("page", fmt.Sprint(page))
q.Set("size", fmt.Sprint(size))
var resp GetPlacementsOutput
path := fmt.Sprintf("api/v1/workspaces/%s/projects/%s/placements?%s", workspaceID, projectID, q.Encode())
var resp PlacementsPage
err := c.do(
ctx,