project.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package types
  2. type Project struct {
  3. ID uint `json:"id"`
  4. Name string `json:"name"`
  5. Roles []*Role `json:"roles"`
  6. }
  7. type CreateProjectRequest struct {
  8. Name string `json:"name" form:"required"`
  9. }
  10. type CreateProjectResponse Project
  11. type CreateProjectRoleRequest struct {
  12. Kind string `json:"kind" form:"required"`
  13. UserID uint `json:"user_id" form:"required"`
  14. }
  15. type ReadProjectResponse Project
  16. type ListProjectsRequest struct{}
  17. type ListProjectsResponse []Project
  18. type DeleteProjectRequest struct {
  19. Name string `json:"name" form:"required"`
  20. }
  21. type DeleteProjectResponse Project
  22. type ListProjectInfraResponse []*Infra
  23. type GetProjectPolicyResponse []*PolicyDocument
  24. type ListProjectRolesResponse []RoleKind
  25. type Collaborator struct {
  26. ID uint `json:"id"`
  27. Kind string `json:"kind"`
  28. UserID uint `json:"user_id"`
  29. Email string `json:"email"`
  30. ProjectID uint `json:"project_id"`
  31. }
  32. type ListCollaboratorsResponse []*Collaborator
  33. type UpdateRoleRequest struct {
  34. UserID uint `json:"user_id,required"`
  35. Kind string `json:"kind,required"`
  36. }
  37. type UpdateRoleResponse struct {
  38. *Role
  39. }
  40. type DeleteRoleRequest struct {
  41. UserID uint `schema:"user_id,required"`
  42. }
  43. type DeleteRoleResponse struct {
  44. *Role
  45. }
  46. type GetBillingTokenResponse struct {
  47. Token string `json:"token"`
  48. }
  49. type GetProjectBillingResponse struct {
  50. HasBilling bool `json:"has_billing"`
  51. }