2020-01-30 13:08:57 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
module Entities
|
|
|
|
class Group < BasicGroupDetails
|
|
|
|
expose :path, :description, :visibility
|
|
|
|
expose :share_with_group_lock
|
|
|
|
expose :require_two_factor_authentication
|
|
|
|
expose :two_factor_grace_period
|
|
|
|
expose :project_creation_level_str, as: :project_creation_level
|
|
|
|
expose :auto_devops_enabled
|
|
|
|
expose :subgroup_creation_level_str, as: :subgroup_creation_level
|
|
|
|
expose :emails_disabled
|
|
|
|
expose :mentions_disabled
|
|
|
|
expose :lfs_enabled?, as: :lfs_enabled
|
2020-03-02 07:07:57 -05:00
|
|
|
expose :default_branch_protection
|
2020-01-30 13:08:57 -05:00
|
|
|
expose :avatar_url do |group, options|
|
|
|
|
group.avatar_url(only_path: false)
|
|
|
|
end
|
|
|
|
expose :request_access_enabled
|
|
|
|
expose :full_name, :full_path
|
2020-03-24 08:09:42 -04:00
|
|
|
expose :created_at
|
2020-01-30 13:08:57 -05:00
|
|
|
expose :parent_id
|
|
|
|
|
|
|
|
expose :custom_attributes, using: 'API::Entities::CustomAttribute', if: :with_custom_attributes
|
|
|
|
|
|
|
|
expose :statistics, if: :statistics do
|
|
|
|
with_options format_with: -> (value) { value.to_i } do
|
|
|
|
expose :storage_size
|
|
|
|
expose :repository_size
|
|
|
|
expose :wiki_size
|
|
|
|
expose :lfs_objects_size
|
|
|
|
expose :build_artifacts_size, as: :job_artifacts_size
|
2021-10-28 08:10:22 -04:00
|
|
|
expose :pipeline_artifacts_size
|
|
|
|
expose :packages_size
|
2020-06-30 14:09:13 -04:00
|
|
|
expose :snippets_size
|
2021-10-28 08:10:22 -04:00
|
|
|
expose :uploads_size
|
2020-01-30 13:08:57 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-02-17 07:09:20 -05:00
|
|
|
|
2021-05-11 17:10:21 -04:00
|
|
|
API::Entities::Group.prepend_mod_with('API::Entities::Group', with_descendants: true)
|