1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-11-27 22:18:45 +02:00

Refactored struct types by reusing already existing components

This commit is contained in:
Andy Grunwald
2016-06-03 23:14:27 +02:00
parent 077933ab00
commit 883aca79c0
3 changed files with 102 additions and 212 deletions

View File

@@ -11,122 +11,59 @@ type ProjectService struct {
// Project list type
type ProjectList []struct {
Expand string `json:"expand"`
Self string `json:"self"`
ID string `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
AvatarUrls struct {
Four8X48 string `json:"48x48"`
Two4X24 string `json:"24x24"`
One6X16 string `json:"16x16"`
Three2X32 string `json:"32x32"`
} `json:"avatarUrls"`
ProjectTypeKey string `json:"projectTypeKey"`
ProjectCategory struct {
Self string `json:"self"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
} `json:"projectCategory,omitempty"`
Expand string `json:"expand"`
Self string `json:"self"`
ID string `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
AvatarUrls AvatarUrls `json:"avatarUrls"`
ProjectTypeKey string `json:"projectTypeKey"`
ProjectCategory ProjectCategory `json:"projectCategory,omitempty"`
}
type ProjectCategory struct {
Self string `json:"self"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}
// Full project description
// Can't name it project because it exist in issue
type FullProject struct {
Expand string `json:"expand"`
Self string `json:"self"`
ID string `json:"id"`
Key string `json:"key"`
Description string `json:"description"`
Lead struct {
Self string `json:"self"`
Name string `json:"name"`
AvatarUrls struct {
Four8X48 string `json:"48x48"`
Two4X24 string `json:"24x24"`
One6X16 string `json:"16x16"`
Three2X32 string `json:"32x32"`
} `json:"avatarUrls"`
DisplayName string `json:"displayName"`
Active bool `json:"active"`
} `json:"lead"`
Components []struct {
Self string `json:"self"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Lead struct {
Self string `json:"self"`
Name string `json:"name"`
AvatarUrls struct {
Four8X48 string `json:"48x48"`
Two4X24 string `json:"24x24"`
One6X16 string `json:"16x16"`
Three2X32 string `json:"32x32"`
} `json:"avatarUrls"`
DisplayName string `json:"displayName"`
Active bool `json:"active"`
} `json:"lead"`
AssigneeType string `json:"assigneeType"`
Assignee struct {
Self string `json:"self"`
Name string `json:"name"`
AvatarUrls struct {
Four8X48 string `json:"48x48"`
Two4X24 string `json:"24x24"`
One6X16 string `json:"16x16"`
Three2X32 string `json:"32x32"`
} `json:"avatarUrls"`
DisplayName string `json:"displayName"`
Active bool `json:"active"`
} `json:"assignee"`
RealAssigneeType string `json:"realAssigneeType"`
RealAssignee struct {
Self string `json:"self"`
Name string `json:"name"`
AvatarUrls struct {
Four8X48 string `json:"48x48"`
Two4X24 string `json:"24x24"`
One6X16 string `json:"16x16"`
Three2X32 string `json:"32x32"`
} `json:"avatarUrls"`
DisplayName string `json:"displayName"`
Active bool `json:"active"`
} `json:"realAssignee"`
IsAssigneeTypeValid bool `json:"isAssigneeTypeValid"`
Project string `json:"project"`
ProjectID int `json:"projectId"`
} `json:"components"`
IssueTypes []struct {
Self string `json:"self"`
ID string `json:"id"`
Description string `json:"description"`
IconURL string `json:"iconUrl"`
Name string `json:"name"`
Subtask bool `json:"subtask"`
AvatarID int `json:"avatarId"`
} `json:"issueTypes"`
URL string `json:"url"`
Email string `json:"email"`
AssigneeType string `json:"assigneeType"`
Versions []interface{} `json:"versions"`
Name string `json:"name"`
Expand string `json:"expand"`
Self string `json:"self"`
ID string `json:"id"`
Key string `json:"key"`
Description string `json:"description"`
Lead User `json:"lead"`
Components []ProjectComponent `json:"components"`
IssueTypes []IssueType `json:"issueTypes"`
URL string `json:"url"`
Email string `json:"email"`
AssigneeType string `json:"assigneeType"`
Versions []interface{} `json:"versions"`
Name string `json:"name"`
Roles struct {
Developers string `json:"Developers"`
} `json:"roles"`
AvatarUrls struct {
Four8X48 string `json:"48x48"`
Two4X24 string `json:"24x24"`
One6X16 string `json:"16x16"`
Three2X32 string `json:"32x32"`
} `json:"avatarUrls"`
ProjectCategory struct {
Self string `json:"self"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
} `json:"projectCategory"`
AvatarUrls AvatarUrls `json:"avatarUrls"`
ProjectCategory ProjectCategory `json:"projectCategory"`
}
type ProjectComponent struct {
Self string `json:"self"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Lead User `json:"lead"`
AssigneeType string `json:"assigneeType"`
Assignee User `json:"assignee"`
RealAssigneeType string `json:"realAssigneeType"`
RealAssignee User `json:"realAssignee"`
IsAssigneeTypeValid bool `json:"isAssigneeTypeValid"`
Project string `json:"project"`
ProjectID int `json:"projectId"`
}
// Get all projects form jira