From ebbfdf498580e0c46d8688364b037730ca288b6e Mon Sep 17 00:00:00 2001 From: Szymon Kodrebski Date: Tue, 20 Aug 2019 17:13:20 +0200 Subject: [PATCH 1/2] Add missing field in users_keys class --- github/users_keys.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 { From 02ddb6c221ee9595ed60de27f6b38fba2199926e Mon Sep 17 00:00:00 2001 From: Szymon Kodrebski Date: Tue, 20 Aug 2019 17:21:22 +0200 Subject: [PATCH 2/2] Add missing field in users_keys class --- github/github-accessors.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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 {