timeEntries.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. package types
  2. type ActivityLinks struct {
  3. Self Self `json:"self"`
  4. Projects []Self `json:"projects"`
  5. }
  6. type AllowedValues struct {
  7. Type string `json:"type"`
  8. Id int `json:"id"`
  9. Name string `json:"name"`
  10. Position int `json:"position"`
  11. Default bool `json:"default"`
  12. Links ActivityLinks `json:"_links"`
  13. }
  14. type Activity struct {
  15. Type string `json:"type"`
  16. Name string `json:"name"`
  17. Required bool `json:"required"`
  18. HasDefault bool `json:"hasDefault"`
  19. Writable bool `json:"writable"`
  20. Location string `json:"location"`
  21. Embedded struct{
  22. AllowedValues []AllowedValues `json:"allowedValues"`
  23. } `json:"_embedded"`
  24. }
  25. type Dependency struct {
  26. }
  27. type Rtl struct {
  28. }
  29. type TimeEntryOption struct {
  30. Rtl Rtl `json:"rtl"`
  31. }
  32. type AllowedValue struct {
  33. Href string `json:"href"`
  34. }
  35. type LinksTimeEntryWP struct {
  36. AllowedValues AllowedValue `json:"allowedValues"`
  37. }
  38. type TimeEntryWP struct {
  39. Type string `json:"type"`
  40. Name string `json:"name"`
  41. Required bool `json:"required"`
  42. HasDefault bool `json:"hasDefault"`
  43. Writable bool `json:"writable"`
  44. Location string `json:"location"`
  45. Links LinksTimeEntryWP `json:"_links"`
  46. }
  47. type Id struct {
  48. Type string `json:"type"`
  49. Name string `json:"name"`
  50. Required bool `json:"required"`
  51. HasDefault bool `json:"hasDefault"`
  52. Writable bool `json:"writable"`
  53. Options TimeEntryOption `json:"options"`
  54. }
  55. type SchemaLinks struct {
  56. }
  57. type Schema struct {
  58. Type string `json:"_type"`
  59. Dependencies []Dependency `json:"_dependencies"`
  60. Id Id `json:"id"`
  61. CreatedAt Id `json:"createdAt"`
  62. UpdatedAt Id `json:"updatedAt"`
  63. SpentOn Id `json:"spentOn"`
  64. Hours Id `json:"hours"`
  65. User Id `json:"user"`
  66. WorkPackage TimeEntryWP `json:"workPackage"`
  67. Project TimeEntryWP `json:"project"`
  68. Activity Activity `json:"activity"`
  69. CustomField1 Id `json:"customField1"`
  70. Links SchemaLinks `json:"_links"`
  71. }
  72. type Link struct {
  73. Href string `json:"href"`
  74. Title string `json:"title"`
  75. }
  76. type PayloadLinks struct {
  77. Project Link `json:"project"`
  78. Activity Link `json:"activity"`
  79. WorkPackage Link `json:"workPackage"`
  80. }
  81. type Comment struct {
  82. Format string `json:"format"`
  83. Raw string `json:"raw"`
  84. Html string `json:"html"`
  85. }
  86. type Payload struct {
  87. Links PayloadLinks `json:"_links"`
  88. Hours string `json:"hours"`
  89. Comment Comment `json:"comment"`
  90. SpentOn string `json:"spentOn"`
  91. CustomField1 Comment `json:"customField1"`
  92. }
  93. type ValidationError struct {
  94. }
  95. type EmbeddedTimeEntry struct {
  96. Payload Payload `json:"payload"`
  97. Schema Schema `json:"schema"`
  98. ValidationErrors ValidationError `json:"validationErrors"`
  99. }
  100. type LinksTimeEntry struct {
  101. Self Self `json:"self"`
  102. Validate Self `json:"validate"`
  103. Commit Self `json:"commit"`
  104. }
  105. type TimeEntries struct {
  106. Type string `json:"_type"`
  107. Embedded EmbeddedTimeEntry `json:"_embedded"`
  108. Links LinksTimeEntry `json:"_links"`
  109. }
  110. type TimeEntriesBody struct {
  111. Links struct{
  112. WorkPackage struct{
  113. Href string `json:"href"`
  114. } `json:"workPackage"`
  115. } `json:"_links"`
  116. }
  117. type TimeEntryPostBody struct {
  118. Links struct{
  119. WorkPackage struct{
  120. Href string `json:"href"`
  121. } `json:"workPackage"`
  122. Activity struct{
  123. Href string `json:"href"`
  124. } `json:"activity"`
  125. Project struct{
  126. Href string `json:"href"`
  127. } `json:"project"`
  128. } `json:"_links"`
  129. }
  130. type UpdateImmediately struct {
  131. Href string `json:"href"`
  132. Method string `json:"method"`
  133. }
  134. type Delete struct {
  135. Href string `json:"href"`
  136. Method string `json:"method"`
  137. }
  138. type TimeLinks struct {
  139. Self Self `json:"self"`
  140. UpdateImmediately UpdateImmediately `json:"updateImmediately"`
  141. Delete Delete `json:"delete"`
  142. Project Link `json:"project"`
  143. WorkPackage Link `json:"workPackage"`
  144. User Link `json:"user"`
  145. Activity Link `json:"activity"`
  146. CustomField1 Link `json:"CustomField1"`
  147. }
  148. type TimeElement struct {
  149. Type string `json:"_type"`
  150. Id int `json:"id"`
  151. Comment Comment `json:"comment"`
  152. SpentOn string `json:"spentOn"`
  153. Hours string `json:"hours"`
  154. CreatedAt string `json:"createdAt"`
  155. UpdatedAt string `json:"updatedAt"`
  156. Links TimeLinks `json:"_links"`
  157. CustomField1 float64 `json:"customField1"`
  158. }
  159. type TimeEntryList struct {
  160. Type string `json:"_type"`
  161. Total int `json:"total"`
  162. Count int `json:"count"`
  163. PageSize int `json:"pageSize"`
  164. Offset int `json:"offset"`
  165. Embedded struct{
  166. Elements []TimeElement `json:"elements"`
  167. } `json:"_embedded"`
  168. }