@@ -16,6 +16,35 @@ import (
16
16
// GitHub API docs: https://docs.github.com/rest/projects/projects
17
17
type ProjectsService service
18
18
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
+
19
48
func (p ProjectV2 ) String () string { return Stringify (p ) }
20
49
21
50
// ListProjectsPaginationOptions specifies optional parameters to list projects for user / organization.
@@ -50,7 +79,6 @@ type ListProjectsOptions struct {
50
79
//
51
80
// GitHub API docs: https://docs.github.com/rest/projects/fields
52
81
type ProjectV2FieldOption struct {
53
- // The unique identifier for this option.
54
82
ID string `json:"id,omitempty"`
55
83
// The display name of the option.
56
84
Name string `json:"name,omitempty"`
@@ -65,14 +93,14 @@ type ProjectV2FieldOption struct {
65
93
//
66
94
// GitHub API docs: https://docs.github.com/rest/projects/fields
67
95
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"`
76
104
}
77
105
78
106
// ListProjectsForOrg lists Projects V2 for an organization.
0 commit comments