diff --git a/github/github-accessors.go b/github/github-accessors.go index 7c89cb60d0b..dfed8203162 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -4612,6 +4612,14 @@ func (i *IssueStats) GetTotalIssues() int { return *i.TotalIssues } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (k *Key) GetCreatedAt() time.Time { + if k == nil || k.CreatedAt == nil { + return time.Time{} + } + return *k.CreatedAt +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (k *Key) GetID() int64 { if k == nil || k.ID == nil { diff --git a/github/users_keys.go b/github/users_keys.go index ddc832a1ece..bb3d0402dfa 100644 --- a/github/users_keys.go +++ b/github/users_keys.go @@ -8,15 +8,17 @@ package github import ( "context" "fmt" + "time" ) // Key represents a public SSH key used to authenticate a user or deploy script. type Key struct { - ID *int64 `json:"id,omitempty"` - Key *string `json:"key,omitempty"` - URL *string `json:"url,omitempty"` - Title *string `json:"title,omitempty"` - ReadOnly *bool `json:"read_only,omitempty"` + ID *int64 `json:"id,omitempty"` + Key *string `json:"key,omitempty"` + URL *string `json:"url,omitempty"` + Title *string `json:"title,omitempty"` + ReadOnly *bool `json:"read_only,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` } func (k Key) String() string {