Module: API::Helpers::ImportGithubHelpers
- Defined in:
- lib/api/helpers/import_github_helpers.rb
Instance Method Summary collapse
- #access_params ⇒ Object
- #client ⇒ Object
- #provider ⇒ Object
- #provider_unauthorized ⇒ Object
- #too_many_requests ⇒ Object
Instance Method Details
#access_params ⇒ Object
11 12 13 14 15 |
# File 'lib/api/helpers/import_github_helpers.rb', line 11 def access_params { github_access_token: params[:personal_access_token] } end |
#client ⇒ Object
6 7 8 9 |
# File 'lib/api/helpers/import_github_helpers.rb', line 6 def client @client ||= Gitlab::GithubImport::Client.new(params[:personal_access_token], host: params[:github_hostname], per_page: params[:pagination_limit]) end |
#provider ⇒ Object
17 18 19 |
# File 'lib/api/helpers/import_github_helpers.rb', line 17 def provider :github end |
#provider_unauthorized ⇒ Object
21 22 23 |
# File 'lib/api/helpers/import_github_helpers.rb', line 21 def error!("Wrong credentials", 401) end |
#too_many_requests ⇒ Object
25 26 27 |
# File 'lib/api/helpers/import_github_helpers.rb', line 25 def too_many_requests error!('Too Many Requests', 429) end |