-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added interface TaigaBaseObject * Added SetFilePath to Attachment struct * Simplified the CreateAttachment implementations
- Loading branch information
1 parent
2033530
commit 51fe438
Showing
13 changed files
with
206 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package taigo | ||
|
||
// TaigaBaseObject represents the following Taiga object types: | ||
/* | ||
* Epic | ||
* User Story | ||
* Task | ||
* Issue | ||
These Taiga objects have the following must-have fields in common: | ||
* ID | ||
* Ref | ||
* Version | ||
* Subject | ||
* Project | ||
*/ | ||
type TaigaBaseObject interface { | ||
GetID() int | ||
GetRef() int | ||
GetVersion() int | ||
GetSubject() string | ||
GetProject() int | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package taigo | ||
|
||
var wikiURI = "/wiki" | ||
|
||
// WikiService is a handle to actions related to Tasks | ||
// | ||
// https://taigaio.github.io/taiga-doc/dist/api.html#tasks | ||
type WikiService struct { | ||
client *Client | ||
} | ||
|
||
// CreateAttachment creates a new Wiki attachment -> https://taigaio.github.io/taiga-doc/dist/api.html#wiki-create-attachment | ||
func (s *WikiService) CreateAttachment(attachment *Attachment, wikiPage *WikiPage) (*Attachment, error) { | ||
url := s.client.APIURL + endpointTasks + "/attachments" | ||
return newfileUploadRequest(s.client, url, attachment, wikiPage) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package taigo | ||
|
||
import "time" | ||
|
||
// WikiPage -> https://taigaio.github.io/taiga-doc/dist/api.html#object-wiki-detail | ||
type WikiPage struct { | ||
TaigaBaseObject | ||
Content string `json:"content"` | ||
CreatedDate time.Time `json:"created_date"` | ||
Editions int `json:"editions"` | ||
HTML string `json:"html"` | ||
ID int `json:"id"` | ||
IsWatcher bool `json:"is_watcher"` | ||
LastModifier int `json:"last_modifier"` | ||
ModifiedDate time.Time `json:"modified_date"` | ||
Owner int `json:"owner"` | ||
Project int `json:"project"` | ||
ProjectExtraInfo struct { | ||
ID int `json:"id"` | ||
LogoSmallURL string `json:"logo_small_url"` | ||
Name string `json:"name"` | ||
Slug string `json:"slug"` | ||
} `json:"project_extra_info"` | ||
Slug string `json:"slug"` | ||
TotalWatchers int `json:"total_watchers"` | ||
Version int `json:"version"` | ||
} | ||
|
||
// GetID returns the ID | ||
func (tgObj *WikiPage) GetID() int { | ||
return tgObj.ID | ||
} | ||
|
||
// GetVersion return the version | ||
func (tgObj *WikiPage) GetVersion() int { | ||
return tgObj.Version | ||
} | ||
|
||
// GetProject returns the project ID | ||
func (tgObj *WikiPage) GetProject() int { | ||
return tgObj.Project | ||
} |