| 534 | } |
| 535 | |
| 536 | func (p ProjectItem) DetailedItem() exportable { |
| 537 | switch p.Type() { |
| 538 | case "DraftIssue": |
| 539 | return DraftIssue{ |
| 540 | ID: p.Content.DraftIssue.ID, |
| 541 | Body: p.Body(), |
| 542 | Title: p.Title(), |
| 543 | } |
| 544 | |
| 545 | case "Issue": |
| 546 | return Issue{ |
| 547 | Body: p.Body(), |
| 548 | Title: p.Title(), |
| 549 | Number: p.Number(), |
| 550 | Repository: struct{ NameWithOwner string }{ |
| 551 | NameWithOwner: p.Repo(), |
| 552 | }, |
| 553 | URL: p.URL(), |
| 554 | } |
| 555 | |
| 556 | case "PullRequest": |
| 557 | return PullRequest{ |
| 558 | Body: p.Body(), |
| 559 | Title: p.Title(), |
| 560 | Number: p.Number(), |
| 561 | Repository: struct{ NameWithOwner string }{ |
| 562 | NameWithOwner: p.Repo(), |
| 563 | }, |
| 564 | URL: p.URL(), |
| 565 | } |
| 566 | } |
| 567 | return nil |
| 568 | } |
| 569 | |
| 570 | // Type is the underlying type of the project item. |
| 571 | func (p ProjectItem) Type() string { |