Skip to content

Commit 0ca0521

Browse files
committed
Address pr comments
1 parent 8ee5bc4 commit 0ca0521

File tree

2 files changed

+37
-38
lines changed

2 files changed

+37
-38
lines changed

github/event_types.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,35 +1111,6 @@ type ProjectV2Event struct {
11111111
Sender *User `json:"sender,omitempty"`
11121112
}
11131113

1114-
// ProjectV2 represents a v2 project.
1115-
type ProjectV2 struct {
1116-
ID *int64 `json:"id,omitempty"`
1117-
NodeID *string `json:"node_id,omitempty"`
1118-
Owner *User `json:"owner,omitempty"`
1119-
Creator *User `json:"creator,omitempty"`
1120-
Title *string `json:"title,omitempty"`
1121-
Description *string `json:"description,omitempty"`
1122-
Public *bool `json:"public,omitempty"`
1123-
ClosedAt *Timestamp `json:"closed_at,omitempty"`
1124-
CreatedAt *Timestamp `json:"created_at,omitempty"`
1125-
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
1126-
DeletedAt *Timestamp `json:"deleted_at,omitempty"`
1127-
Number *int `json:"number,omitempty"`
1128-
ShortDescription *string `json:"short_description,omitempty"`
1129-
DeletedBy *User `json:"deleted_by,omitempty"`
1130-
1131-
// Fields migrated from the Project (classic) struct:
1132-
URL *string `json:"url,omitempty"`
1133-
HTMLURL *string `json:"html_url,omitempty"`
1134-
ColumnsURL *string `json:"columns_url,omitempty"`
1135-
OwnerURL *string `json:"owner_url,omitempty"`
1136-
Name *string `json:"name,omitempty"`
1137-
Body *string `json:"body,omitempty"`
1138-
State *string `json:"state,omitempty"`
1139-
OrganizationPermission *string `json:"organization_permission,omitempty"`
1140-
Private *bool `json:"private,omitempty"`
1141-
}
1142-
11431114
// ProjectV2ItemEvent is triggered when there is activity relating to an item on an organization-level project.
11441115
// The Webhook event name is "projects_v2_item".
11451116
//

github/projects.go

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,35 @@ import (
1616
// GitHub API docs: https://docs.github.com/rest/projects/projects
1717
type ProjectsService service
1818

19+
// ProjectV2 represents a v2 project.
20+
type ProjectV2 struct {
21+
ID *int64 `json:"id,omitempty"`
22+
NodeID *string `json:"node_id,omitempty"`
23+
Owner *User `json:"owner,omitempty"`
24+
Creator *User `json:"creator,omitempty"`
25+
Title *string `json:"title,omitempty"`
26+
Description *string `json:"description,omitempty"`
27+
Public *bool `json:"public,omitempty"`
28+
ClosedAt *Timestamp `json:"closed_at,omitempty"`
29+
CreatedAt *Timestamp `json:"created_at,omitempty"`
30+
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
31+
DeletedAt *Timestamp `json:"deleted_at,omitempty"`
32+
Number *int `json:"number,omitempty"`
33+
ShortDescription *string `json:"short_description,omitempty"`
34+
DeletedBy *User `json:"deleted_by,omitempty"`
35+
36+
// Fields migrated from the Project (classic) struct:
37+
URL *string `json:"url,omitempty"`
38+
HTMLURL *string `json:"html_url,omitempty"`
39+
ColumnsURL *string `json:"columns_url,omitempty"`
40+
OwnerURL *string `json:"owner_url,omitempty"`
41+
Name *string `json:"name,omitempty"`
42+
Body *string `json:"body,omitempty"`
43+
State *string `json:"state,omitempty"`
44+
OrganizationPermission *string `json:"organization_permission,omitempty"`
45+
Private *bool `json:"private,omitempty"`
46+
}
47+
1948
func (p ProjectV2) String() string { return Stringify(p) }
2049

2150
// ListProjectsPaginationOptions specifies optional parameters to list projects for user / organization.
@@ -50,7 +79,6 @@ type ListProjectsOptions struct {
5079
//
5180
// GitHub API docs: https://docs.github.com/rest/projects/fields
5281
type ProjectV2FieldOption struct {
53-
// The unique identifier for this option.
5482
ID string `json:"id,omitempty"`
5583
// The display name of the option.
5684
Name string `json:"name,omitempty"`
@@ -65,14 +93,14 @@ type ProjectV2FieldOption struct {
6593
//
6694
// GitHub API docs: https://docs.github.com/rest/projects/fields
6795
type ProjectV2Field struct {
68-
ID *int64 `json:"id,omitempty"` // The unique identifier for this field.
69-
NodeID string `json:"node_id,omitempty"` // The GraphQL node ID for this field.
70-
Name string `json:"name,omitempty"` // The display name of the field.
71-
DataType string `json:"dataType,omitempty"` // The data type of the field (e.g., "text", "number", "date", "single_select", "multi_select").
72-
URL string `json:"url,omitempty"` // The API URL for this field.
73-
Options []*ProjectV2FieldOption `json:"options,omitempty"` // Available options for single_select and multi_select fields.
74-
CreatedAt *Timestamp `json:"created_at,omitempty"` // The time when this field was created.
75-
UpdatedAt *Timestamp `json:"updated_at,omitempty"` // The time when this field was last updated.
96+
ID *int64 `json:"id,omitempty"`
97+
NodeID string `json:"node_id,omitempty"`
98+
Name string `json:"name,omitempty"`
99+
DataType string `json:"dataType,omitempty"`
100+
URL string `json:"url,omitempty"`
101+
Options []*ProjectV2FieldOption `json:"options,omitempty"`
102+
CreatedAt *Timestamp `json:"created_at,omitempty"`
103+
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
76104
}
77105

78106
// ListProjectsForOrg lists Projects V2 for an organization.

0 commit comments

Comments
 (0)