This commit is contained in:
Artem Tsyrulnikov
2026-01-19 16:47:52 +03:00
parent 6b410f89cc
commit a90c8b7df6
20 changed files with 205 additions and 343 deletions

View File

@@ -245,10 +245,11 @@ func (c *Client) GetProjects(
func (c *Client) GetProject(
ctx context.Context,
jwt string,
workspaceID string,
projectID string,
) (*Project, error) {
path := fmt.Sprintf("api/v1/internal/projects/%s/%s", workspaceID, projectID)
path := fmt.Sprintf("api/v1/workspaces/%s/projects/%s", workspaceID, projectID)
var project Project
err := c.do(
@@ -257,6 +258,7 @@ func (c *Client) GetProject(
path,
nil,
&project,
withBearer(jwt),
)
return &project, err
@@ -558,13 +560,14 @@ type PlacementDetails struct {
}
type PlacementOutput struct {
ID string `json:"id"`
Status string `json:"status"`
Comment *string `json:"comment,omitempty"`
InviteLink string `json:"invite_link"`
InviteLinkType string `json:"invite_link_type"`
Channel Channel `json:"channel"`
Details *PlacementDetails `json:"details,omitempty"`
ID string `json:"id"`
Status string `json:"status"`
Comment *string `json:"comment,omitempty"`
InviteLink string `json:"invite_link"`
InviteLinkType string `json:"invite_link_type"`
Channel Channel `json:"channel"`
Details *PlacementDetails `json:"details,omitempty"`
PlacementPosts []PlacementPostOutput `json:"placement_posts,omitempty"`
}
type PlacementPostOutput struct {
@@ -594,10 +597,6 @@ type GetPlacementsOutput struct {
Placements []PlacementOutput `json:"placements"`
}
type GetPlacementPostsOutput struct {
PlacementPosts []PlacementPostOutput `json:"placement_posts"`
}
func (c *Client) CreatePlacements(
ctx context.Context,
jwt string,
@@ -664,39 +663,6 @@ func (c *Client) GetPlacement(
return &placement, err
}
func (c *Client) GetPlacementPosts(
ctx context.Context,
jwt string,
workspaceID string,
projectID *string,
placementID *string,
) (*GetPlacementPostsOutput, error) {
q := url.Values{}
if projectID != nil && *projectID != "" {
q.Set("project_id", *projectID)
}
if placementID != nil && *placementID != "" {
q.Set("placement_id", *placementID)
}
path := fmt.Sprintf("api/v1/workspaces/%s/placement_posts", workspaceID)
if len(q) > 0 {
path += "?" + q.Encode()
}
var resp GetPlacementPostsOutput
err := c.do(
ctx,
http.MethodGet,
path,
nil,
&resp,
withBearer(jwt),
)
return &resp, err
}
// ============================================================================
// Workspace Members
// ============================================================================