Commit 821468a6 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Rémy Coutable

Refactor nuget entities into own class files

parent 38703248
---
title: Separate nuget package entities into own class files
merge_request: 27898
author: Rajendra Kadam
type: added
# frozen_string_literal: true
module EE
module API
module Entities
########################
# EE-specific entities #
########################
module Nuget
class ServiceIndex < Grape::Entity
expose :version
expose :resources
end
class PackageMetadataCatalogEntry < Grape::Entity
expose :json_url, as: :@id
expose :authors
expose :dependencies, as: :dependencyGroups
expose :package_name, as: :id
expose :package_version, as: :version
expose :archive_url, as: :packageContent
expose :summary
end
class PackageMetadata < Grape::Entity
expose :json_url, as: :@id
expose :archive_url, as: :packageContent
expose :catalog_entry, as: :catalogEntry, using: EE::API::Entities::Nuget::PackageMetadataCatalogEntry
end
class PackagesMetadataItem < Grape::Entity
expose :json_url, as: :@id
expose :lower_version, as: :lower
expose :upper_version, as: :upper
expose :packages_count, as: :count
expose :packages, as: :items, using: EE::API::Entities::Nuget::PackageMetadata
end
class PackagesMetadata < Grape::Entity
expose :count
expose :items, using: EE::API::Entities::Nuget::PackagesMetadataItem
end
class PackagesVersions < Grape::Entity
expose :versions
end
class SearchResultVersion < Grape::Entity
expose :json_url, as: :@id
expose :version
expose :downloads
end
class SearchResult < Grape::Entity
expose :type, as: :@type
expose :authors
expose :name, as: :id
expose :name, as: :title
expose :summary
expose :total_downloads, as: :totalDownloads
expose :verified
expose :version
expose :versions, using: EE::API::Entities::Nuget::SearchResultVersion
end
class SearchResults < Grape::Entity
expose :total_count, as: :totalHits
expose :data, using: EE::API::Entities::Nuget::SearchResult
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
module Nuget
class PackageMetadata < Grape::Entity
expose :json_url, as: :@id
expose :archive_url, as: :packageContent
expose :catalog_entry, as: :catalogEntry, using: EE::API::Entities::Nuget::PackageMetadataCatalogEntry
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
module Nuget
class PackageMetadataCatalogEntry < Grape::Entity
expose :json_url, as: :@id
expose :authors
expose :dependencies, as: :dependencyGroups
expose :package_name, as: :id
expose :package_version, as: :version
expose :archive_url, as: :packageContent
expose :summary
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
module Nuget
class PackagesMetadata < Grape::Entity
expose :count
expose :items, using: EE::API::Entities::Nuget::PackagesMetadataItem
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
module Nuget
class PackagesMetadataItem < Grape::Entity
expose :json_url, as: :@id
expose :lower_version, as: :lower
expose :upper_version, as: :upper
expose :packages_count, as: :count
expose :packages, as: :items, using: EE::API::Entities::Nuget::PackageMetadata
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
module Nuget
class PackagesVersions < Grape::Entity
expose :versions
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
module Nuget
class SearchResult < Grape::Entity
expose :type, as: :@type
expose :authors
expose :name, as: :id
expose :name, as: :title
expose :summary
expose :total_downloads, as: :totalDownloads
expose :verified
expose :version
expose :versions, using: EE::API::Entities::Nuget::SearchResultVersion
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
module Nuget
class SearchResultVersion < Grape::Entity
expose :json_url, as: :@id
expose :version
expose :downloads
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
module Nuget
class SearchResults < Grape::Entity
expose :total_count, as: :totalHits
expose :data, using: EE::API::Entities::Nuget::SearchResult
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
module Nuget
class ServiceIndex < Grape::Entity
expose :version
expose :resources
end
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