Browse Source

RepositoryRelease struct: Add Assets field

The release assets are included in the release object, but they are not being
parsed currently. To get the list of release assets, one must use
ListReleaseAssets, which is one extra unnecessary HTTP request.

This commit adds Assets field to RepositoryRelease struct so that the release
assets are immediately available right after calling ListReleases.

Signed-off-by: Ondřej Kupka <ondra.cap@gmail.com>
Ondřej Kupka 11 years ago
committed by Will Norris
parent
commit
f812049b5d
1 changed files with 14 additions and 13 deletions
  1. +14
    -13
      github/repos_releases.go

+ 14
- 13
github/repos_releases.go View File

@ -15,19 +15,20 @@ import (
// RepositoryRelease represents a GitHub release in a repository. // RepositoryRelease represents a GitHub release in a repository.
type RepositoryRelease struct { type RepositoryRelease struct {
ID *int `json:"id,omitempty"`
TagName *string `json:"tag_name,omitempty"`
TargetCommitish *string `json:"target_commitish,omitempty"`
Name *string `json:"name,omitempty"`
Body *string `json:"body,omitempty"`
Draft *bool `json:"draft,omitempty"`
Prerelease *bool `json:"prerelease,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
PublishedAt *Timestamp `json:"published_at,omitempty"`
URL *string `json:"url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
AssetsURL *string `json:"assets_url,omitempty"`
UploadURL *string `json:"upload_url,omitempty"`
ID *int `json:"id,omitempty"`
TagName *string `json:"tag_name,omitempty"`
TargetCommitish *string `json:"target_commitish,omitempty"`
Name *string `json:"name,omitempty"`
Body *string `json:"body,omitempty"`
Draft *bool `json:"draft,omitempty"`
Prerelease *bool `json:"prerelease,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
PublishedAt *Timestamp `json:"published_at,omitempty"`
URL *string `json:"url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
AssetsURL *string `json:"assets_url,omitempty"`
Assets []ReleaseAsset `json:"assets,omitempty"`
UploadURL *string `json:"upload_url,omitempty"`
} }
func (r RepositoryRelease) String() string { func (r RepositoryRelease) String() string {


Loading…
Cancel
Save