code.gitea.io/gitea@v1.22.3/modules/structs/release.go (about) 1 // Copyright 2016 The Gitea Authors. All rights reserved. 2 // SPDX-License-Identifier: MIT 3 4 package structs 5 6 import ( 7 "time" 8 ) 9 10 // Release represents a repository release 11 type Release struct { 12 ID int64 `json:"id"` 13 TagName string `json:"tag_name"` 14 Target string `json:"target_commitish"` 15 Title string `json:"name"` 16 Note string `json:"body"` 17 URL string `json:"url"` 18 HTMLURL string `json:"html_url"` 19 TarURL string `json:"tarball_url"` 20 ZipURL string `json:"zipball_url"` 21 UploadURL string `json:"upload_url"` 22 IsDraft bool `json:"draft"` 23 IsPrerelease bool `json:"prerelease"` 24 // swagger:strfmt date-time 25 CreatedAt time.Time `json:"created_at"` 26 // swagger:strfmt date-time 27 PublishedAt time.Time `json:"published_at"` 28 Publisher *User `json:"author"` 29 Attachments []*Attachment `json:"assets"` 30 } 31 32 // CreateReleaseOption options when creating a release 33 type CreateReleaseOption struct { 34 // required: true 35 TagName string `json:"tag_name" binding:"Required"` 36 Target string `json:"target_commitish"` 37 Title string `json:"name"` 38 Note string `json:"body"` 39 IsDraft bool `json:"draft"` 40 IsPrerelease bool `json:"prerelease"` 41 } 42 43 // EditReleaseOption options when editing a release 44 type EditReleaseOption struct { 45 TagName string `json:"tag_name"` 46 Target string `json:"target_commitish"` 47 Title string `json:"name"` 48 Note string `json:"body"` 49 IsDraft *bool `json:"draft"` 50 IsPrerelease *bool `json:"prerelease"` 51 }