Skip to content

Commit b1e5502

Browse files
committed
update types
1 parent 4005aa3 commit b1e5502

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

pkg/github/projects.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const (
2323
ProjectAddFailedError = "failed to add a project item"
2424
ProjectDeleteFailedError = "failed to delete a project item"
2525
ProjectListFailedError = "failed to list project items"
26-
MaxProjectsPerPage = 20
26+
MaxProjectsPerPage = 50
2727
)
2828

2929
// ProjectRead creates a tool to perform read operations on GitHub Projects V2.
@@ -541,7 +541,7 @@ func getProjectField(ctx context.Context, client *github.Client, owner string, o
541541
url = fmt.Sprintf("users/%s/projectsV2/%d/fields/%d", owner, projectNumber, fieldID)
542542
}
543543

544-
var projectField github.ProjectV2Field
544+
var projectField projectV2Field
545545

546546
httpRequest, err := client.NewRequest("GET", url, nil)
547547
if err != nil {
@@ -600,7 +600,7 @@ func listProjectFields(ctx context.Context, client *github.Client, owner string,
600600
return nil, fmt.Errorf("failed to create request: %w", err)
601601
}
602602

603-
var projectFields []*github.ProjectV2Field
603+
var projectFields []*projectV2Field
604604
resp, err := client.Do(ctx, httpRequest, &projectFields)
605605
if err != nil {
606606
return ghErrors.NewGitHubAPIErrorResponse(ctx,
@@ -876,6 +876,18 @@ type updateProjectItem struct {
876876
Value any `json:"value"`
877877
}
878878

879+
type projectV2Field struct {
880+
ID *int64 `json:"id,omitempty"`
881+
NodeID string `json:"node_id,omitempty"`
882+
Name string `json:"name,omitempty"`
883+
DataType string `json:"data_type,omitempty"`
884+
URL string `json:"url,omitempty"`
885+
Options []*any `json:"options,omitempty"` // For single-select fields
886+
Configuration []*any `json:"configuration,omitempty"` // For iteration fields
887+
CreatedAt *github.Timestamp `json:"created_at,omitempty"`
888+
UpdatedAt *github.Timestamp `json:"updated_at,omitempty"`
889+
}
890+
879891
type projectV2ItemFieldValue struct {
880892
ID *int64 `json:"id,omitempty"` // The unique identifier for this field.
881893
Name string `json:"name,omitempty"` // The display name of the field.

0 commit comments

Comments
 (0)