diff options
Diffstat (limited to 'lib/api/entities/nuget')
-rw-r--r-- | lib/api/entities/nuget/dependency.rb | 14 | ||||
-rw-r--r-- | lib/api/entities/nuget/dependency_group.rb | 14 | ||||
-rw-r--r-- | lib/api/entities/nuget/metadatum.rb | 13 | ||||
-rw-r--r-- | lib/api/entities/nuget/package_metadata.rb | 13 | ||||
-rw-r--r-- | lib/api/entities/nuget/package_metadata_catalog_entry.rb | 19 | ||||
-rw-r--r-- | lib/api/entities/nuget/packages_metadata.rb | 12 | ||||
-rw-r--r-- | lib/api/entities/nuget/packages_metadata_item.rb | 15 | ||||
-rw-r--r-- | lib/api/entities/nuget/packages_versions.rb | 11 | ||||
-rw-r--r-- | lib/api/entities/nuget/search_result.rb | 21 | ||||
-rw-r--r-- | lib/api/entities/nuget/search_result_version.rb | 13 | ||||
-rw-r--r-- | lib/api/entities/nuget/search_results.rb | 12 | ||||
-rw-r--r-- | lib/api/entities/nuget/service_index.rb | 12 |
12 files changed, 169 insertions, 0 deletions
diff --git a/lib/api/entities/nuget/dependency.rb b/lib/api/entities/nuget/dependency.rb new file mode 100644 index 00000000000..b61c37f5882 --- /dev/null +++ b/lib/api/entities/nuget/dependency.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class Dependency < Grape::Entity + expose :id, as: :@id + expose :type, as: :@type + expose :name, as: :id + expose :range + end + end + end +end diff --git a/lib/api/entities/nuget/dependency_group.rb b/lib/api/entities/nuget/dependency_group.rb new file mode 100644 index 00000000000..dcab9359fcf --- /dev/null +++ b/lib/api/entities/nuget/dependency_group.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class DependencyGroup < Grape::Entity + expose :id, as: :@id + expose :type, as: :@type + expose :target_framework, as: :targetFramework, expose_nil: false + expose :dependencies, using: ::API::Entities::Nuget::Dependency + end + end + end +end diff --git a/lib/api/entities/nuget/metadatum.rb b/lib/api/entities/nuget/metadatum.rb new file mode 100644 index 00000000000..87caef41a85 --- /dev/null +++ b/lib/api/entities/nuget/metadatum.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class Metadatum < Grape::Entity + expose :project_url, as: :projectUrl, expose_nil: false + expose :license_url, as: :licenseUrl, expose_nil: false + expose :icon_url, as: :iconUrl, expose_nil: false + end + end + end +end diff --git a/lib/api/entities/nuget/package_metadata.rb b/lib/api/entities/nuget/package_metadata.rb new file mode 100644 index 00000000000..e1c2a1ae161 --- /dev/null +++ b/lib/api/entities/nuget/package_metadata.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +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: ::API::Entities::Nuget::PackageMetadataCatalogEntry + end + end + end +end diff --git a/lib/api/entities/nuget/package_metadata_catalog_entry.rb b/lib/api/entities/nuget/package_metadata_catalog_entry.rb new file mode 100644 index 00000000000..5533f857596 --- /dev/null +++ b/lib/api/entities/nuget/package_metadata_catalog_entry.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class PackageMetadataCatalogEntry < Grape::Entity + expose :json_url, as: :@id + expose :authors + expose :dependency_groups, as: :dependencyGroups, using: ::API::Entities::Nuget::DependencyGroup + expose :package_name, as: :id + expose :package_version, as: :version + expose :tags + expose :archive_url, as: :packageContent + expose :summary + expose :metadatum, using: ::API::Entities::Nuget::Metadatum, merge: true + end + end + end +end diff --git a/lib/api/entities/nuget/packages_metadata.rb b/lib/api/entities/nuget/packages_metadata.rb new file mode 100644 index 00000000000..1cdf2491725 --- /dev/null +++ b/lib/api/entities/nuget/packages_metadata.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class PackagesMetadata < Grape::Entity + expose :count + expose :items, using: ::API::Entities::Nuget::PackagesMetadataItem + end + end + end +end diff --git a/lib/api/entities/nuget/packages_metadata_item.rb b/lib/api/entities/nuget/packages_metadata_item.rb new file mode 100644 index 00000000000..84cc79166f3 --- /dev/null +++ b/lib/api/entities/nuget/packages_metadata_item.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +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: ::API::Entities::Nuget::PackageMetadata + end + end + end +end diff --git a/lib/api/entities/nuget/packages_versions.rb b/lib/api/entities/nuget/packages_versions.rb new file mode 100644 index 00000000000..498c6970d5c --- /dev/null +++ b/lib/api/entities/nuget/packages_versions.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class PackagesVersions < Grape::Entity + expose :versions + end + end + end +end diff --git a/lib/api/entities/nuget/search_result.rb b/lib/api/entities/nuget/search_result.rb new file mode 100644 index 00000000000..8e028cbad95 --- /dev/null +++ b/lib/api/entities/nuget/search_result.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +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: ::API::Entities::Nuget::SearchResultVersion + expose :tags + expose :metadatum, using: ::API::Entities::Nuget::Metadatum, merge: true + end + end + end +end diff --git a/lib/api/entities/nuget/search_result_version.rb b/lib/api/entities/nuget/search_result_version.rb new file mode 100644 index 00000000000..9032c964c44 --- /dev/null +++ b/lib/api/entities/nuget/search_result_version.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class SearchResultVersion < Grape::Entity + expose :json_url, as: :@id + expose :version + expose :downloads + end + end + end +end diff --git a/lib/api/entities/nuget/search_results.rb b/lib/api/entities/nuget/search_results.rb new file mode 100644 index 00000000000..22a77dc7b6c --- /dev/null +++ b/lib/api/entities/nuget/search_results.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class SearchResults < Grape::Entity + expose :total_count, as: :totalHits + expose :data, using: ::API::Entities::Nuget::SearchResult + end + end + end +end diff --git a/lib/api/entities/nuget/service_index.rb b/lib/api/entities/nuget/service_index.rb new file mode 100644 index 00000000000..e57bd04adb9 --- /dev/null +++ b/lib/api/entities/nuget/service_index.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class ServiceIndex < Grape::Entity + expose :version + expose :resources + end + end + end +end |