Commit ce2c2131 authored by Rajendra Kadam's avatar Rajendra Kadam

Add entities files

parent fed5327f
# frozen_string_literal: true
module EE
module API
module Entities
# Being used in private MR-level approvals API.
# This overrides the `eligible_approvers` to be exposed as `approvers`.
#
# To be removed in https://gitlab.com/gitlab-org/gitlab/issues/13574.
class MergeRequestApprovalSettingRule < MergeRequestApprovalStateRule
expose :approvers, using: ::API::Entities::UserBasic, override: true
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
# Being used in private MR-level approvals API.
# This overrides the `rules` to be exposed using MergeRequestApprovalSettingRule.
#
# To be removed in https://gitlab.com/gitlab-org/gitlab/issues/13574.
class MergeRequestApprovalSettings < MergeRequestApprovalState
expose :wrapped_approval_rules, as: :rules, using: MergeRequestApprovalSettingRule, override: true
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
# Being used in private project-level approvals API.
# This overrides the `eligible_approvers` to be exposed as `approvers`.
#
# To be removed in https://gitlab.com/gitlab-org/gitlab/issues/13574.
class ProjectApprovalSettingRule < ProjectApprovalRule
expose :approvers, using: ::API::Entities::UserBasic, override: true
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
# Being used in private project-level approvals API.
#
# To be removed in https://gitlab.com/gitlab-org/gitlab/issues/13574.
class ProjectApprovalSettings < Grape::Entity
expose :rules, using: ProjectApprovalSettingRule do |project, options|
project.visible_approval_rules(target_branch: options[:target_branch])
end
expose :min_fallback_approvals, as: :fallback_approvals_required
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment