| 567 | } |
| 568 | |
| 569 | func (p ProjectItem) DetailedItem() exportable { |
| 570 | switch p.Type() { |
| 571 | case "DraftIssue": |
| 572 | return DraftIssue{ |
| 573 | ID: p.Content.DraftIssue.ID, |
| 574 | Body: p.Body(), |
| 575 | Title: p.Title(), |
| 576 | } |
| 577 | |
| 578 | case "Issue": |
| 579 | return Issue{ |
| 580 | Body: p.Body(), |
| 581 | Title: p.Title(), |
| 582 | Number: p.Number(), |
| 583 | Repository: struct{ NameWithOwner string }{ |
| 584 | NameWithOwner: p.Repo(), |
| 585 | }, |
| 586 | URL: p.URL(), |
| 587 | } |
| 588 | |
| 589 | case "PullRequest": |
| 590 | return PullRequest{ |
| 591 | Body: p.Body(), |
| 592 | Title: p.Title(), |
| 593 | Number: p.Number(), |
| 594 | Repository: struct{ NameWithOwner string }{ |
| 595 | NameWithOwner: p.Repo(), |
| 596 | }, |
| 597 | URL: p.URL(), |
| 598 | } |
| 599 | } |
| 600 | return nil |
| 601 | } |
| 602 | |
| 603 | // Type is the underlying type of the project item. |
| 604 | func (p ProjectItem) Type() string { |