From c259ad4fdbdeca7acb9fe839340478ad1d94c07b Mon Sep 17 00:00:00 2001 From: Elliott Beach Date: Wed, 23 Aug 2017 10:38:24 -0500 Subject: [PATCH 1/4] (#605) Rename Authorizations.UpdateAt => UpdatedAt --- github/authorizations.go | 2 +- github/github-accessors.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/github/authorizations.go b/github/authorizations.go index d87adc0bdc4..638745ac1de 100644 --- a/github/authorizations.go +++ b/github/authorizations.go @@ -63,7 +63,7 @@ type Authorization struct { App *AuthorizationApp `json:"app,omitempty"` Note *string `json:"note,omitempty"` NoteURL *string `json:"note_url,omitempty"` - UpdateAt *Timestamp `json:"updated_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` Fingerprint *string `json:"fingerprint,omitempty"` diff --git a/github/github-accessors.go b/github/github-accessors.go index 7ba31b19744..4fed8e50a62 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -100,12 +100,12 @@ func (a *Authorization) GetTokenLastEight() string { return *a.TokenLastEight } -// GetUpdateAt returns the UpdateAt field if it's non-nil, zero value otherwise. -func (a *Authorization) GetUpdateAt() Timestamp { - if a == nil || a.UpdateAt == nil { +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (a *Authorization) GetUpdatedAt() Timestamp { + if a == nil || a.UpdatedAt == nil { return Timestamp{} } - return *a.UpdateAt + return *a.UpdatedAt } // GetURL returns the URL field if it's non-nil, zero value otherwise. From 4624ee38d0c098cecbae2eeb111d6fa43472a99b Mon Sep 17 00:00:00 2001 From: Elliott Beach Date: Thu, 24 Aug 2017 06:56:21 -0500 Subject: [PATCH 2/4] (#605) Rename DeploymentStatus.UpdatedAt => PushedAt --- github/github-accessors.go | 16 ++++++++-------- github/repos_deployments.go | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 4fed8e50a62..66c3148ce31 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1180,6 +1180,14 @@ func (d *DeploymentStatus) GetID() int { return *d.ID } +// GetPushedAt returns the PushedAt field if it's non-nil, zero value otherwise. +func (d *DeploymentStatus) GetPushedAt() Timestamp { + if d == nil || d.PushedAt == nil { + return Timestamp{} + } + return *d.PushedAt +} + // GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise. func (d *DeploymentStatus) GetRepositoryURL() string { if d == nil || d.RepositoryURL == nil { @@ -1204,14 +1212,6 @@ func (d *DeploymentStatus) GetTargetURL() string { return *d.TargetURL } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (d *DeploymentStatus) GetUpdatedAt() Timestamp { - if d == nil || d.UpdatedAt == nil { - return Timestamp{} - } - return *d.UpdatedAt -} - // GetAutoInactive returns the AutoInactive field if it's non-nil, zero value otherwise. func (d *DeploymentStatusRequest) GetAutoInactive() bool { if d == nil || d.AutoInactive == nil { diff --git a/github/repos_deployments.go b/github/repos_deployments.go index 9054ca9472e..a1eb11e505b 100644 --- a/github/repos_deployments.go +++ b/github/repos_deployments.go @@ -137,7 +137,7 @@ type DeploymentStatus struct { Description *string `json:"description,omitempty"` TargetURL *string `json:"target_url,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"pushed_at,omitempty"` + PushedAt *Timestamp `json:"pushed_at,omitempty"` DeploymentURL *string `json:"deployment_url,omitempty"` RepositoryURL *string `json:"repository_url,omitempty"` } From 4d216692f40abd4dfa0d3b13ce52810f2d68926b Mon Sep 17 00:00:00 2001 From: Elliott Beach Date: Wed, 30 Aug 2017 10:45:12 -0500 Subject: [PATCH 3/4] [#605] Fix the Deployments json fields to be updated_at, not pushed_at --- github/github-accessors.go | 16 ++++++++-------- github/repos_deployments.go | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 66c3148ce31..4fed8e50a62 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1180,14 +1180,6 @@ func (d *DeploymentStatus) GetID() int { return *d.ID } -// GetPushedAt returns the PushedAt field if it's non-nil, zero value otherwise. -func (d *DeploymentStatus) GetPushedAt() Timestamp { - if d == nil || d.PushedAt == nil { - return Timestamp{} - } - return *d.PushedAt -} - // GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise. func (d *DeploymentStatus) GetRepositoryURL() string { if d == nil || d.RepositoryURL == nil { @@ -1212,6 +1204,14 @@ func (d *DeploymentStatus) GetTargetURL() string { return *d.TargetURL } +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (d *DeploymentStatus) GetUpdatedAt() Timestamp { + if d == nil || d.UpdatedAt == nil { + return Timestamp{} + } + return *d.UpdatedAt +} + // GetAutoInactive returns the AutoInactive field if it's non-nil, zero value otherwise. func (d *DeploymentStatusRequest) GetAutoInactive() bool { if d == nil || d.AutoInactive == nil { diff --git a/github/repos_deployments.go b/github/repos_deployments.go index a1eb11e505b..ec0e8421573 100644 --- a/github/repos_deployments.go +++ b/github/repos_deployments.go @@ -23,7 +23,7 @@ type Deployment struct { Description *string `json:"description,omitempty"` Creator *User `json:"creator,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"pushed_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` StatusesURL *string `json:"statuses_url,omitempty"` RepositoryURL *string `json:"repository_url,omitempty"` } @@ -137,7 +137,7 @@ type DeploymentStatus struct { Description *string `json:"description,omitempty"` TargetURL *string `json:"target_url,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` - PushedAt *Timestamp `json:"pushed_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` DeploymentURL *string `json:"deployment_url,omitempty"` RepositoryURL *string `json:"repository_url,omitempty"` } From 7f746a5d850fc5f8fdb7b9d8c3600837517cc50e Mon Sep 17 00:00:00 2001 From: Elliott Beach Date: Wed, 30 Aug 2017 19:29:12 -0500 Subject: [PATCH 4/4] Bump library version as this is a breaking change. --- github/github.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/github.go b/github/github.go index 1a009293abd..99ad8d078d0 100644 --- a/github/github.go +++ b/github/github.go @@ -27,7 +27,7 @@ import ( ) const ( - libraryVersion = "10" + libraryVersion = "11" defaultBaseURL = "https://api.github.com/" uploadBaseURL = "https://uploads.github.com/" userAgent = "go-github/" + libraryVersion