code.gitea.io/gitea@v1.22.3/modules/structs/issue_label.go (about) 1 // Copyright 2016 The Gogs Authors. All rights reserved. 2 // Copyright 2019 The Gitea Authors. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 5 package structs 6 7 // Label a label to an issue or a pr 8 // swagger:model 9 type Label struct { 10 ID int64 `json:"id"` 11 Name string `json:"name"` 12 // example: false 13 Exclusive bool `json:"exclusive"` 14 // example: false 15 IsArchived bool `json:"is_archived"` 16 // example: 00aabb 17 Color string `json:"color"` 18 Description string `json:"description"` 19 URL string `json:"url"` 20 } 21 22 // CreateLabelOption options for creating a label 23 type CreateLabelOption struct { 24 // required:true 25 Name string `json:"name" binding:"Required"` 26 // example: false 27 Exclusive bool `json:"exclusive"` 28 // required:true 29 // example: #00aabb 30 Color string `json:"color" binding:"Required"` 31 Description string `json:"description"` 32 // example: false 33 IsArchived bool `json:"is_archived"` 34 } 35 36 // EditLabelOption options for editing a label 37 type EditLabelOption struct { 38 Name *string `json:"name"` 39 // example: false 40 Exclusive *bool `json:"exclusive"` 41 // example: #00aabb 42 Color *string `json:"color"` 43 Description *string `json:"description"` 44 // example: false 45 IsArchived *bool `json:"is_archived"` 46 } 47 48 // IssueLabelsOption a collection of labels 49 type IssueLabelsOption struct { 50 // Labels can be a list of integers representing label IDs 51 // or a list of strings representing label names 52 Labels []any `json:"labels"` 53 } 54 55 // LabelTemplate info of a Label template 56 type LabelTemplate struct { 57 Name string `json:"name"` 58 // example: false 59 Exclusive bool `json:"exclusive"` 60 // example: 00aabb 61 Color string `json:"color"` 62 Description string `json:"description"` 63 }