debian-mirror-gitlab/lib/api/entities/resource_milestone_event.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
817 B
Ruby
Raw Permalink Normal View History

2020-06-23 00:09:42 +05:30
# frozen_string_literal: true
module API
module Entities
class ResourceMilestoneEvent < Grape::Entity
2023-01-13 00:05:48 +05:30
expose :id, documentation: { type: 'integer', example: 142 }
2020-06-23 00:09:42 +05:30
expose :user, using: Entities::UserBasic
2023-01-13 00:05:48 +05:30
expose :created_at, documentation: { type: 'dateTime', example: '2018-08-20T13:38:20.077Z' }
expose :resource_type, documentation: { type: 'string', example: 'Issue' } do |event, _options|
2020-06-23 00:09:42 +05:30
event.issuable.class.name
end
2023-01-13 00:05:48 +05:30
expose :resource_id, documentation: { type: 'integer', example: 253 } do |event, _options|
2020-06-23 00:09:42 +05:30
event.issuable.id
end
expose :milestone, using: Entities::Milestone
2023-01-13 00:05:48 +05:30
expose :action, documentation: { type: 'string', example: 'add' }
expose :state, documentation: { type: 'string', example: 'active' }
2020-06-23 00:09:42 +05:30
end
end
end