Class: ActiveProject::Adapters::GithubProjectAdapter
- Includes:
- ActiveProject::Adapters::GithubProject::Comments, ActiveProject::Adapters::GithubProject::Connection, ActiveProject::Adapters::GithubProject::Issues, ActiveProject::Adapters::GithubProject::Projects, ActiveProject::Adapters::GithubProject::Webhooks
- Defined in:
- lib/active_project/adapters/github_project_adapter.rb
Constant Summary
Constants included from ActiveProject::Adapters::GithubProject::Issues
ActiveProject::Adapters::GithubProject::Issues::DEFAULT_ITEM_PAGE_SIZE
Constants included from ActiveProject::Adapters::GithubProject::Connection
ActiveProject::Adapters::GithubProject::Connection::ENDPOINT
Constants included from Connections::HttpClient
Connections::HttpClient::DEFAULT_HEADERS, Connections::HttpClient::DEFAULT_RETRY_OPTS
Instance Attribute Summary
Attributes included from Connections::HttpClient
Attributes inherited from Base
Instance Method Summary collapse
- #adapter_type ⇒ Object
- #connected? ⇒ Boolean
- #delete_issue(id, context = {}) ⇒ Object
- #get_current_user ⇒ Object
- #issues ⇒ Object
- #projects ⇒ Object
- #update_issue(id, attributes, context = {}) ⇒ Object
Methods included from ActiveProject::Adapters::GithubProject::Webhooks
#parse_webhook, #verify_webhook_signature
Methods included from ActiveProject::Adapters::GithubProject::Comments
#add_comment, #delete_comment, #update_comment
Methods included from ActiveProject::Adapters::GithubProject::Issues
#create_issue, #delete_issue_original, #find_issue, #list_issues, #status_known?, #update_issue_original
Methods included from ActiveProject::Adapters::GithubProject::Helpers
#fetch_all_pages, #map_user, #owner_node_id, #project_field_ids
Methods included from ActiveProject::Adapters::GithubProject::Projects
#create_project, #delete_project, #find_project, #list_projects
Methods included from ActiveProject::Adapters::GithubProject::Connection
Methods included from Connections::GraphQl
Methods included from Connections::Pagination
Methods included from Connections::HttpClient
Methods included from Connections::Base
Methods inherited from Base
#add_comment, #create_issue, #create_list, #create_project, #delete_comment, #delete_project, #denormalize_status, #find_issue, #find_project, #initialize, #list_issues, #list_projects, #normalize_status, #parse_webhook, #status_known?, #supports_webhooks?, #update_comment, #valid_statuses, #verify_webhook_signature, webhook_type, #webhook_type
Instance Method Details
#adapter_type ⇒ Object
27 28 29 |
# File 'lib/active_project/adapters/github_project_adapter.rb', line 27 def adapter_type :github_project end |
#connected? ⇒ Boolean
21 22 23 24 25 |
# File 'lib/active_project/adapters/github_project_adapter.rb', line 21 def connected? = begin !get_current_user.nil? rescue StandardError false end |
#delete_issue(id, context = {}) ⇒ Object
37 38 39 40 41 |
# File 'lib/active_project/adapters/github_project_adapter.rb', line 37 def delete_issue(id, context = {}) project_id = context[:project_id] || raise(ArgumentError, "GithubProjectAdapter requires :project_id in context") delete_issue_internal(project_id, id) end |
#get_current_user ⇒ Object
15 16 17 18 19 |
# File 'lib/active_project/adapters/github_project_adapter.rb', line 15 def get_current_user q = "query{viewer{ id login name email }}" data = request_gql(query: q) map_user_data(data["viewer"]) end |
#issues ⇒ Object
13 |
# File 'lib/active_project/adapters/github_project_adapter.rb', line 13 def issues = ResourceFactory.new(adapter: self, resource_class: Resources::Issue) |
#projects ⇒ Object
12 |
# File 'lib/active_project/adapters/github_project_adapter.rb', line 12 def projects = ResourceFactory.new(adapter: self, resource_class: Resources::Project) |
#update_issue(id, attributes, context = {}) ⇒ Object
31 32 33 34 35 |
# File 'lib/active_project/adapters/github_project_adapter.rb', line 31 def update_issue(id, attributes, context = {}) project_id = context[:project_id] || raise(ArgumentError, "GithubProjectAdapter requires :project_id in context") update_issue_internal(project_id, id, attributes) end |