Sha256: a725345c28d666c2cba29293be69cb40c501e48e0b7aa9cfeda004892dcc9d44

Contents?: true

Size: 1.7 KB

Versions: 7

Compression:

Stored size: 1.7 KB

Contents

require "pulpcore_client"

module Katello
  module Pulp3
    module Api
      class Generic < Core
        attr_accessor :repository_type

        def initialize(smart_proxy, repository_type)
          @repository_type = repository_type
          super(smart_proxy)
        end

        def self.api_exception_class
          fail NotImplementedError
        end

        def self.client_module(repository_type)
          repository_type.client_module_class
        end

        def self.remote_class(repository_type)
          repository_type.remote_class
        end

        def self.distribution_class(repository_type)
          repository_type.distribution_class
        end

        def self.publication_class(repository_type)
          repository_type.publication_class
        end

        def self.repository_sync_url_class(repository_type)
          repository_type.repo_sync_url_class
        end

        def self.add_remove_content_class
          fail NotImplementedError
        end

        def api_client
          api_client_class(@repository_type.api_class.new(smart_proxy.pulp3_configuration(@repository_type.configuration_class)))
        end

        def repositories_api
          @repository_type.repositories_api_class.new(api_client)
        end

        def repository_versions_api
          @repository_type.repository_versions_api_class.new(api_client)
        end

        def remotes_api
          @repository_type.remotes_api_class.new(api_client)
        end

        def publications_api
          @repository_type.publications_api_class.new(api_client)
        end

        def distributions_api
          @repository_type.distributions_api_class.new(api_client)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
katello-4.2.2 app/services/katello/pulp3/api/generic.rb
katello-4.2.1 app/services/katello/pulp3/api/generic.rb
katello-4.2.0.1 app/services/katello/pulp3/api/generic.rb
katello-4.2.0.1.rc3 app/services/katello/pulp3/api/generic.rb
katello-4.2.0.1.rc2 app/services/katello/pulp3/api/generic.rb
katello-4.2.0.rc2 app/services/katello/pulp3/api/generic.rb
katello-4.2.0.rc1 app/services/katello/pulp3/api/generic.rb