@@ -76,7 +76,7 @@ type Link struct {
7676 CreatedAt time.Time `json:"created-date"`
7777
7878 // UpdatedByUserID is the user who last updated this link.
79- UpdatedByUserID * int64 `json:"updated-by-userId"`
79+ UpdatedByUserID * LegacyNumber `json:"updated-by-userId"`
8080
8181 // UpdatedAt is the date and time when the link was last updated.
8282 UpdatedAt * time.Time `json:"updated-date"`
@@ -559,7 +559,11 @@ type LinkListResponse struct {
559559 request LinkListRequest
560560 hasMore bool
561561
562- Links []Link `json:"links"`
562+ // Links is the list of links matching the request filters. This field is not
563+ // directly decoded from the API response, but is populated in the
564+ // HandleHTTPResponse method, which decodes the response and extracts the
565+ // links from it.
566+ Links []Link `json:"-"`
563567}
564568
565569// HandleHTTPResponse handles the HTTP response for the LinkListResponse. If
@@ -574,9 +578,23 @@ func (l *LinkListResponse) HandleHTTPResponse(resp *http.Response) error {
574578 pages , _ := strconv .ParseInt (resp .Header .Get ("X-Pages" ), 10 , 64 )
575579 l .hasMore = pages > page
576580
577- if err := json .NewDecoder (resp .Body ).Decode (l ); err != nil {
581+ var links struct {
582+ Project struct {
583+ Links []Link `json:"links"`
584+ } `json:"project"`
585+ Projects []struct {
586+ Links []Link `json:"links"`
587+ } `json:"projects"`
588+ }
589+
590+ if err := json .NewDecoder (resp .Body ).Decode (& links ); err != nil {
578591 return fmt .Errorf ("failed to decode list links response: %w" , err )
579592 }
593+
594+ l .Links = links .Project .Links
595+ for _ , project := range links .Projects {
596+ l .Links = append (l .Links , project .Links ... )
597+ }
580598 return nil
581599}
582600
0 commit comments