Skip to content

Commit

Permalink
support maniphest.gettasktransactions
Browse files Browse the repository at this point in the history
  • Loading branch information
ccl0326 committed Oct 27, 2016
1 parent e1e23cc commit 04a5c6a
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -121,6 +121,7 @@ for more information on how to use them.
- macro.creatememe
- maniphest.query
- maniphest.createtask
- maniphest.gettasktransactions
- paste.create
- paste.query
- phid.lookup
Expand Down
16 changes: 16 additions & 0 deletions entities/maniphest_task_transaction.go
@@ -0,0 +1,16 @@
package entities

import "github.com/etcinit/gonduit/util"

// ManiphestTaskTranscation represents a single task's transcation on Maniphest.
type ManiphestTaskTranscation struct {
TaskID string `json:"taskID"`
TransactionID string `json:"transactionID"`
TransactionPHID string `json:"transactionPHID"`
TransactionType string `json:"transactionType"`
OldValue interface{} `json:"oldValue"`
NewValue interface{} `json:"newValue"`
Comments string `json:"comments"`
AuthorPHID string `json:"authorPHID"`
DateCreated util.UnixTimestamp `json:"dateCreated"`
}
12 changes: 12 additions & 0 deletions maniphest.go
Expand Up @@ -31,3 +31,15 @@ func (c *Conn) ManiphestCreateTask(

return &res, nil
}

func (c *Conn) ManiphestGetTaskTransactions(
req requests.ManiphestGetTaskTransactions,
) (*responses.ManiphestGetTaskTransactionsResponse, error) {
var res responses.ManiphestGetTaskTransactionsResponse

if err := c.Call("maniphest.gettasktransactions", &req, &res); err != nil {
return nil, err
}

return &res, nil
}
7 changes: 7 additions & 0 deletions requests/maniphest_gettasktransactions.go
@@ -0,0 +1,7 @@
package requests

// ManiphestGetTaskTransactions represents a request to maniphest.gettasktransactions.
type ManiphestGetTaskTransactions struct {
IDs []string `json:"ids"`
Request
}
6 changes: 6 additions & 0 deletions responses/maniphest_gettasktransactions.go
@@ -0,0 +1,6 @@
package responses

import "github.com/etcinit/gonduit/entities"

// ManiphestGetTaskTransactionsResponse is the response of calling maniphest.query.
type ManiphestGetTaskTransactionsResponse map[string][]*entities.ManiphestTaskTranscation

0 comments on commit 04a5c6a

Please sign in to comment.