From 99be4ed648281febcff5060b87c4ef30881ff0e2 Mon Sep 17 00:00:00 2001 From: Miles Crabill Date: Wed, 9 Oct 2024 18:18:47 -0700 Subject: [PATCH] feat: Add Expired to RepositoryInvitation --- github/github-accessors.go | 8 ++++++++ github/github-accessors_test.go | 11 +++++++++++ github/repos_invitations.go | 1 + 3 files changed, 20 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index 1c1f6c33e39..f3a16c10ae1 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -20238,6 +20238,14 @@ func (r *RepositoryInvitation) GetCreatedAt() Timestamp { return *r.CreatedAt } +// GetExpired returns the Expired field if it's non-nil, zero value otherwise. +func (r *RepositoryInvitation) GetExpired() bool { + if r == nil || r.Expired == nil { + return false + } + return *r.Expired +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (r *RepositoryInvitation) GetHTMLURL() string { if r == nil || r.HTMLURL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 4692094303f..2086baa0fda 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -25999,6 +25999,17 @@ func TestRepositoryInvitation_GetCreatedAt(tt *testing.T) { r.GetCreatedAt() } +func TestRepositoryInvitation_GetExpired(tt *testing.T) { + tt.Parallel() + var zeroValue bool + r := &RepositoryInvitation{Expired: &zeroValue} + r.GetExpired() + r = &RepositoryInvitation{} + r.GetExpired() + r = nil + r.GetExpired() +} + func TestRepositoryInvitation_GetHTMLURL(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/repos_invitations.go b/github/repos_invitations.go index 4922e0b298c..98fe01d1c9a 100644 --- a/github/repos_invitations.go +++ b/github/repos_invitations.go @@ -23,6 +23,7 @@ type RepositoryInvitation struct { CreatedAt *Timestamp `json:"created_at,omitempty"` URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` + Expired *bool `json:"expired,omitempty"` } // ListInvitations lists all currently-open repository invitations.