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

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

module API
  module Entities
    class ProtectedRefAccess < Grape::Entity
      expose :id, documentation: { type: 'integer', example: 1 }
      expose :access_level, documentation: { type: 'integer', example: 40 }
      expose :access_level_description,
        documentation: { type: 'string', example: 'Maintainers' } do |protected_ref_access|
          protected_ref_access.humanize
        end
      expose :deploy_key_id, documentation: { type: 'integer', example: 1 },
        if: ->(access) { access.has_attribute?(:deploy_key_id) && access.deploy_key_id }
    end
  end
end

API::Entities::ProtectedRefAccess.prepend_mod_with('API::Entities::ProtectedRefAccess')