2012-06-27 13:32:56 +02:00
|
|
|
module Gitlab
|
|
|
|
module Entities
|
|
|
|
class User < Grape::Entity
|
|
|
|
expose :id, :email, :name, :bio, :skype, :linkedin, :twitter,
|
|
|
|
:dark_scheme, :theme_id, :blocked, :created_at
|
|
|
|
end
|
2012-06-27 14:51:39 +02:00
|
|
|
|
2012-07-05 15:47:00 +02:00
|
|
|
class UserBasic < Grape::Entity
|
|
|
|
expose :id, :email, :name, :blocked, :created_at
|
|
|
|
end
|
|
|
|
|
2012-09-08 19:51:12 +02:00
|
|
|
class Hook < Grape::Entity
|
|
|
|
expose :id, :url
|
|
|
|
end
|
|
|
|
|
2012-06-27 14:51:39 +02:00
|
|
|
class Project < Grape::Entity
|
|
|
|
expose :id, :code, :name, :description, :path, :default_branch
|
2012-08-11 00:07:50 +02:00
|
|
|
expose :owner, using: Entities::UserBasic
|
|
|
|
expose :private_flag, as: :private
|
2012-06-27 14:51:39 +02:00
|
|
|
expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :created_at
|
|
|
|
end
|
|
|
|
|
2012-09-06 22:49:29 +02:00
|
|
|
class UsersProject < Grape::Entity
|
|
|
|
expose :user, using: Entities::UserBasic
|
|
|
|
expose :project_access
|
|
|
|
end
|
|
|
|
|
2012-07-06 15:08:17 +02:00
|
|
|
class RepoObject < Grape::Entity
|
2012-06-27 14:51:39 +02:00
|
|
|
expose :name, :commit
|
|
|
|
end
|
2012-06-29 15:34:08 +02:00
|
|
|
|
|
|
|
class ProjectSnippet < Grape::Entity
|
|
|
|
expose :id, :title, :file_name
|
2012-08-11 00:07:50 +02:00
|
|
|
expose :author, using: Entities::UserBasic
|
2012-06-29 15:34:08 +02:00
|
|
|
expose :expires_at, :updated_at, :created_at
|
|
|
|
end
|
2012-07-24 14:19:51 +02:00
|
|
|
|
|
|
|
class Milestone < Grape::Entity
|
|
|
|
expose :id, :title, :description, :due_date, :closed, :updated_at, :created_at
|
|
|
|
end
|
|
|
|
|
|
|
|
class Issue < Grape::Entity
|
2012-07-25 13:22:21 +02:00
|
|
|
expose :id
|
|
|
|
expose (:project_id) {|issue| issue.project.id}
|
|
|
|
expose :title, :description
|
2012-08-11 00:07:50 +02:00
|
|
|
expose :label_list, as: :labels
|
|
|
|
expose :milestone, using: Entities::Milestone
|
|
|
|
expose :assignee, :author, using: Entities::UserBasic
|
2012-07-24 14:19:51 +02:00
|
|
|
expose :closed, :updated_at, :created_at
|
|
|
|
end
|
2012-06-27 13:32:56 +02:00
|
|
|
end
|
|
|
|
end
|