Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 47 additions & 21 deletions go/pkg/basecamp/cards.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,40 @@ type CardTable struct {

// CardColumn represents a column in a card table.
type CardColumn struct {
ID int64 `json:"id"`
Status string `json:"status"`
VisibleToClients bool `json:"visible_to_clients"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Title string `json:"title"`
InheritsStatus bool `json:"inherits_status"`
Type string `json:"type"`
URL string `json:"url"`
AppURL string `json:"app_url"`
BookmarkURL string `json:"bookmark_url"`
Position int `json:"position,omitempty"`
Color string `json:"color,omitempty"`
Description string `json:"description,omitempty"`
CardsCount int `json:"cards_count"`
CommentCount int `json:"comment_count"`
CardsURL string `json:"cards_url,omitempty"`
Parent *Parent `json:"parent,omitempty"`
Bucket *Bucket `json:"bucket,omitempty"`
Creator *Person `json:"creator,omitempty"`
Subscribers []Person `json:"subscribers,omitempty"`
ID int64 `json:"id"`
Status string `json:"status"`
VisibleToClients bool `json:"visible_to_clients"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Title string `json:"title"`
InheritsStatus bool `json:"inherits_status"`
Type string `json:"type"`
URL string `json:"url"`
AppURL string `json:"app_url"`
BookmarkURL string `json:"bookmark_url"`
Position int `json:"position,omitempty"`
Color string `json:"color,omitempty"`
Description string `json:"description,omitempty"`
CardsCount int `json:"cards_count"`
CommentCount int `json:"comment_count"`
CardsURL string `json:"cards_url,omitempty"`
OnHold *CardColumnOnHold `json:"on_hold,omitempty"`
Parent *Parent `json:"parent,omitempty"`
Bucket *Bucket `json:"bucket,omitempty"`
Creator *Person `json:"creator,omitempty"`
Subscribers []Person `json:"subscribers,omitempty"`
}

// CardColumnOnHold represents the on-hold section of a card column.
type CardColumnOnHold struct {
ID int64 `json:"id"`
Status string `json:"status"`
InheritsStatus bool `json:"inherits_status"`
Title string `json:"title"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
CardsCount int `json:"cards_count"`
CardsURL string `json:"cards_url"`
}

// Card represents a card in a card table column.
Expand Down Expand Up @@ -1253,6 +1266,19 @@ func cardColumnFromGenerated(gc generated.CardColumn) CardColumn {
}
}

if gc.OnHold.Id != 0 {
cc.OnHold = &CardColumnOnHold{
ID: gc.OnHold.Id,
Status: gc.OnHold.Status,
InheritsStatus: gc.OnHold.InheritsStatus,
Title: gc.OnHold.Title,
CreatedAt: gc.OnHold.CreatedAt,
UpdatedAt: gc.OnHold.UpdatedAt,
CardsCount: int(gc.OnHold.CardsCount),
CardsURL: gc.OnHold.CardsUrl,
}
}

if len(gc.Subscribers) > 0 {
cc.Subscribers = make([]Person, 0, len(gc.Subscribers))
for _, gs := range gc.Subscribers {
Expand Down
62 changes: 62 additions & 0 deletions go/pkg/basecamp/cards_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ func TestCardTable_Unmarshal(t *testing.T) {
if inProgress.Position != 1 {
t.Errorf("expected position 1, got %d", inProgress.Position)
}
if inProgress.OnHold == nil {
t.Fatal("expected In Progress OnHold to be non-nil")
}
if inProgress.OnHold.ID != 1069479350 {
t.Errorf("expected OnHold.ID 1069479350, got %d", inProgress.OnHold.ID)
}
if inProgress.OnHold.CardsCount != 1 {
t.Errorf("expected OnHold.CardsCount 1, got %d", inProgress.OnHold.CardsCount)
}

// Verify done column
done := cardTable.Lists[2]
Expand Down Expand Up @@ -318,6 +327,29 @@ func TestCardColumn_Unmarshal(t *testing.T) {
t.Errorf("expected Parent.Type 'Kanban::Board', got %q", column.Parent.Type)
}

// Verify on_hold
if column.OnHold == nil {
t.Fatal("expected OnHold to be non-nil")
}
if column.OnHold.ID != 9999999 {
t.Errorf("expected OnHold.ID 9999999, got %d", column.OnHold.ID)
}
if column.OnHold.Status != "active" {
t.Errorf("expected OnHold.Status 'active', got %q", column.OnHold.Status)
}
if !column.OnHold.InheritsStatus {
t.Error("expected OnHold.InheritsStatus to be true")
}
if column.OnHold.Title != "On hold" {
t.Errorf("expected OnHold.Title 'On hold', got %q", column.OnHold.Title)
}
if column.OnHold.CardsCount != 0 {
t.Errorf("expected OnHold.CardsCount 0, got %d", column.OnHold.CardsCount)
}
if column.OnHold.CardsURL != "https://3.basecampapi.com/195539477/buckets/2085958499/card_tables/lists/9999999/cards.json" {
t.Errorf("expected OnHold.CardsURL, got %q", column.OnHold.CardsURL)
}

// Verify subscribers
if len(column.Subscribers) != 1 {
t.Fatalf("expected 1 subscriber, got %d", len(column.Subscribers))
Expand All @@ -327,6 +359,36 @@ func TestCardColumn_Unmarshal(t *testing.T) {
}
}

func TestCardColumn_Unmarshal_NoOnHold(t *testing.T) {
data := []byte(`{
"id": 100,
"status": "active",
"visible_to_clients": false,
"created_at": "2024-01-15T09:31:00.000-06:00",
"updated_at": "2024-01-20T14:45:00.000-06:00",
"title": "Backlog",
"inherits_status": true,
"type": "Kanban::Column",
"url": "https://3.basecampapi.com/1/buckets/2/card_tables/columns/100.json",
"app_url": "https://3.basecamp.com/1/buckets/2/card_tables/columns/100",
"bookmark_url": "https://3.basecampapi.com/1/my/bookmarks/100.json",
"position": 0,
"color": "white",
"cards_count": 0,
"comment_count": 0,
"cards_url": "https://3.basecampapi.com/1/buckets/2/card_tables/lists/100/cards.json"
}`)

var column CardColumn
if err := json.Unmarshal(data, &column); err != nil {
t.Fatalf("failed to unmarshal: %v", err)
}

if column.OnHold != nil {
t.Errorf("expected OnHold to be nil, got %+v", column.OnHold)
}
}

func TestCardStep_Unmarshal(t *testing.T) {
data := loadCardsFixture(t, "step.json")

Expand Down
55 changes: 34 additions & 21 deletions go/pkg/generated/client.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ data class CardColumn(
@SerialName("cards_count") val cardsCount: Int = 0,
@SerialName("comments_count") val commentsCount: Int = 0,
@SerialName("cards_url") val cardsUrl: String? = null,
val subscribers: List<Person> = emptyList()
val subscribers: List<Person> = emptyList(),
@SerialName("on_hold") val onHold: CardColumnOnHold? = null
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.basecamp.sdk.generated.models

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonObject

/**
* CardColumnOnHold entity from the Basecamp API.
*
* @generated from OpenAPI spec — do not edit directly
*/
@Serializable
data class CardColumnOnHold(
val id: Long,
val status: String,
@SerialName("inherits_status") val inheritsStatus: Boolean,
val title: String,
@SerialName("created_at") val createdAt: String,
@SerialName("updated_at") val updatedAt: String,
@SerialName("cards_count") val cardsCount: Int,
@SerialName("cards_url") val cardsUrl: String
)
55 changes: 55 additions & 0 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -18835,6 +18835,9 @@
"items": {
"$ref": "#/components/schemas/Person"
}
},
"on_hold": {
"$ref": "#/components/schemas/CardColumnOnHold"
}
},
"required": [
Expand All @@ -18853,6 +18856,58 @@
"visible_to_clients"
]
},
"CardColumnOnHold": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"x-go-type-skip-optional-pointer": false
},
"status": {
"type": "string"
},
"inherits_status": {
"type": "boolean"
},
"title": {
"type": "string"
},
"created_at": {
"type": "string",
"x-go-type": "time.Time",
"x-go-type-import": {
"path": "time"
},
"x-go-type-skip-optional-pointer": true
},
"updated_at": {
"type": "string",
"x-go-type": "time.Time",
"x-go-type-import": {
"path": "time"
},
"x-go-type-skip-optional-pointer": true
},
"cards_count": {
"type": "integer",
"format": "int32"
},
"cards_url": {
"type": "string"
}
},
"required": [
"cards_count",
"cards_url",
"created_at",
"id",
"inherits_status",
"status",
"title",
"updated_at"
]
},
"CardStep": {
"type": "object",
"properties": {
Expand Down
13 changes: 12 additions & 1 deletion ruby/lib/basecamp/generated/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://basecamp.com/schemas/sdk-metadata.json",
"version": "1.0.0",
"generated": "2026-03-16T01:24:22Z",
"generated": "2026-03-16T07:14:48Z",
"operations": {
"CreateAttachment": {
"retry": {
Expand Down Expand Up @@ -826,6 +826,17 @@
"maxPageSize": 50
}
},
"ListLineupMarkers": {
"retry": {
"maxAttempts": 3,
"baseDelayMs": 1000,
"backoff": "exponential",
"retryOn": [
429,
503
]
}
},
"CreateLineupMarker": {
"retry": {
"maxAttempts": 2,
Expand Down
Loading
Loading