Welcome to mirror list, hosted at ThFree Co, Russian Federation.

resource_milestone_event.rb « entities « api « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b301f5b7d0ac5176c18acf723ba65d3ad7f779c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

module API
  module Entities
    class ResourceMilestoneEvent < Grape::Entity
      expose :id, documentation: { type: 'integer', example: 142 }
      expose :user, using: Entities::UserBasic
      expose :created_at, documentation: { type: 'dateTime', example: '2018-08-20T13:38:20.077Z' }
      expose :resource_type, documentation: { type: 'string', example: 'Issue' } do |event, _options|
        event.issuable.class.name
      end
      expose :resource_id, documentation: { type: 'integer', example: 253 } do |event, _options|
        event.issuable.id
      end
      expose :milestone, using: Entities::Milestone
      expose :action, documentation: { type: 'string', example: 'add' }
      expose :state, documentation: { type: 'string', example: 'active' }
    end
  end
end