2020-06-15 11:08:20 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Import::ProviderRepoSerializer < BaseSerializer
|
|
|
|
def represent(repo, opts = {})
|
|
|
|
entity =
|
|
|
|
case opts[:provider]
|
|
|
|
when :fogbugz
|
|
|
|
Import::FogbugzProviderRepoEntity
|
|
|
|
when :github, :gitea
|
|
|
|
Import::GithubishProviderRepoEntity
|
|
|
|
when :bitbucket
|
|
|
|
Import::BitbucketProviderRepoEntity
|
|
|
|
when :bitbucket_server
|
|
|
|
Import::BitbucketServerProviderRepoEntity
|
|
|
|
when :gitlab
|
|
|
|
Import::GitlabProviderRepoEntity
|
2020-08-18 20:10:34 -04:00
|
|
|
when :manifest
|
|
|
|
Import::ManifestProviderRepoEntity
|
2020-06-15 11:08:20 -04:00
|
|
|
else
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
super(repo, opts, entity)
|
|
|
|
end
|
|
|
|
end
|