contacts.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package contacts
  2. import "surdeus.su/core/amo/common"
  3. type Contact struct {
  4. ID int `json:"id"`
  5. Name string `json:"name,omitempty"`
  6. FirstName string `json:"first_name,omitempty"`
  7. LastName string `json:"last_name,omitempty"`
  8. ResponsibleUserID int `json:"responsible_user_id,omitempty"`
  9. GroupID int `json:"group_id,omitempty"`
  10. CreatedBy int `json:"created_by,omitempty"`
  11. UpdatedBy int `json:"updated_by,omitempty"`
  12. CreatedAt int `json:"created_at,omitempty"`
  13. UpdatedAt int `json:"updated_at,omitempty"`
  14. ClosestTaskAt interface{} `json:"closest_task_at,omitempty"`
  15. CustomFieldsValues common.CustomFieldsValues `json:"custom_fields_values,omitempty"`
  16. AccountID int `json:"account_id,omitempty"`
  17. Links Links `json:"_links,omitempty"`
  18. Embedded Embedded `json:"_embedded,omitempty"`
  19. }
  20. type Values struct {
  21. Value string `json:"value"`
  22. EnumID int `json:"enum_id"`
  23. Enum string `json:"enum"`
  24. }
  25. type Self struct {
  26. Href string `json:"href"`
  27. }
  28. type Links struct {
  29. Self Self `json:"self"`
  30. }
  31. type Leads struct {
  32. ID int `json:"id"`
  33. Links Links `json:"_links"`
  34. }
  35. type Customers struct {
  36. ID int `json:"id"`
  37. Links Links `json:"_links"`
  38. }
  39. type Company struct {
  40. ID int `json:"id"`
  41. Links Links `json:"_links"`
  42. }
  43. type Embedded struct {
  44. Tags []interface{} `json:"tags"`
  45. Leads []Leads `json:"leads"`
  46. Customers []Customers `json:"customers"`
  47. CatalogElements []interface{} `json:"catalog_elements"`
  48. Companies []Company `json:"companies"`
  49. }
  50. type Contacts struct {
  51. Page int `json:"_page"`
  52. Links struct {
  53. Self struct {
  54. Href string `json:"href"`
  55. } `json:"self"`
  56. Next struct {
  57. Href string `json:"href"`
  58. } `json:"next"`
  59. } `json:"_links"`
  60. Embedded struct {
  61. Contacts []Contact `json:"contacts"`
  62. } `json:"_embedded"`
  63. }