Module: Octokit::Client::Projects
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/projects.rb
Overview
Methods for Projects API
Instance Method Summary collapse
-
#column_cards(id, options = {}) ⇒ Array<Sawyer::Resource>
List columns cards.
-
#create_org_project(org, name, options = {}) ⇒ Sawyer::Resource
(also: #create_organization_project)
Create organization project.
-
#create_project(repo, name, options = {}) ⇒ Sawyer::Resource
Create a project.
-
#create_project_card(id, options = {}) ⇒ Sawyer::Resource
Create project card.
-
#create_project_column(id, name, options = {}) ⇒ Sawyer::Resource
Create a project column.
-
#delete_project(id, options = {}) ⇒ Boolean
Delete a project.
-
#delete_project_card(id, options = {}) ⇒ Boolean
Delete a project card.
-
#delete_project_column(id, options = {}) ⇒ Boolean
Delete a project column.
-
#move_project_card(id, position, options = {}) ⇒ Sawyer::Resource
Move a project card.
-
#move_project_column(id, position, options = {}) ⇒ Sawyer::Resource
Move a project column.
-
#org_projects(org, options = {}) ⇒ Array<Sawyer::Resource>
(also: #organization_projects)
List organization projects.
-
#project(id, options = {}) ⇒ Sawyer::Resource
Get a project by id.
-
#project_card(id, options = {}) ⇒ Sawyer::Resource
Get a project card.
-
#project_column(id, options = {}) ⇒ Sawyer::Resource
Get a project column by ID.
-
#project_columns(id, options = {}) ⇒ Array<Sawyer::Resource>
List project columns.
-
#projects(repo, options = {}) ⇒ Array<Sawyer::Resource>
List projects for a repository.
-
#update_project(id, options = {}) ⇒ Sawyer::Resource
Update a project.
-
#update_project_card(id, options = {}) ⇒ Sawyer::Resource
Update a project card.
-
#update_project_column(id, name, options = {}) ⇒ Sawyer::Resource
Update a project column.
Instance Method Details
#column_cards(id, options = {}) ⇒ Array<Sawyer::Resource>
List columns cards
Requires authenticated client
217 218 219 220 |
# File 'lib/octokit/client/projects.rb', line 217 def column_cards(id, = {}) opts = ensure_api_media_type(:projects, ) paginate "projects/columns/#{id}/cards", opts end |
#create_org_project(org, name, options = {}) ⇒ Sawyer::Resource Also known as: create_organization_project
Create organization project
Requires authenticated client
71 72 73 74 75 |
# File 'lib/octokit/client/projects.rb', line 71 def create_org_project(org, name, = {}) opts = ensure_api_media_type(:projects, ) opts[:name] = name post "orgs/#{org}/projects", opts end |
#create_project(repo, name, options = {}) ⇒ Sawyer::Resource
Create a project
Requires authenticated client
37 38 39 40 41 |
# File 'lib/octokit/client/projects.rb', line 37 def create_project(repo, name, = {}) opts = ensure_api_media_type(:projects, ) opts[:name] = name post "#{Repository.path repo}/projects", opts end |
#create_project_card(id, options = {}) ⇒ Sawyer::Resource
If :note is supplied, :content_id and :content_type must be excluded. Similarly, if :content_id is supplied, :content_type must be set and :note must not be included.
Create project card
Requires authenticated client
240 241 242 243 |
# File 'lib/octokit/client/projects.rb', line 240 def create_project_card(id, = {}) opts = ensure_api_media_type(:projects, ) post "projects/columns/#{id}/cards", opts end |
#create_project_column(id, name, options = {}) ⇒ Sawyer::Resource
Create a project column
Requires authenticated client
142 143 144 145 146 |
# File 'lib/octokit/client/projects.rb', line 142 def create_project_column(id, name, = {}) opts = ensure_api_media_type(:projects, ) opts[:name] = name post "projects/#{id}/columns", opts end |
#delete_project(id, options = {}) ⇒ Boolean
Delete a project
Requires authenticated client
115 116 117 118 |
# File 'lib/octokit/client/projects.rb', line 115 def delete_project(id, = {}) opts = ensure_api_media_type(:projects, ) boolean_from_response :delete, "projects/#{id}", opts end |
#delete_project_card(id, options = {}) ⇒ Boolean
Delete a project card
Requires authenticated client
307 308 309 310 |
# File 'lib/octokit/client/projects.rb', line 307 def delete_project_card(id, = {}) opts = ensure_api_media_type(:projects, ) boolean_from_response :delete, "projects/columns/cards/#{id}", opts end |
#delete_project_column(id, options = {}) ⇒ Boolean
Delete a project column
Requires authenticated client
185 186 187 188 |
# File 'lib/octokit/client/projects.rb', line 185 def delete_project_column(id, = {}) opts = ensure_api_media_type(:projects, ) boolean_from_response :delete, "projects/columns/#{id}", opts end |
#move_project_card(id, position, options = {}) ⇒ Sawyer::Resource
Move a project card
Requires authenticated client
292 293 294 295 296 |
# File 'lib/octokit/client/projects.rb', line 292 def move_project_card(id, position, = {}) opts = ensure_api_media_type(:projects, ) opts[:position] = position post "projects/columns/cards/#{id}/moves", opts end |
#move_project_column(id, position, options = {}) ⇒ Sawyer::Resource
Move a project column
Requires authenticated client
202 203 204 205 206 |
# File 'lib/octokit/client/projects.rb', line 202 def move_project_column(id, position, = {}) opts = ensure_api_media_type(:projects, ) opts[:position] = position post "projects/columns/#{id}/moves", opts end |
#org_projects(org, options = {}) ⇒ Array<Sawyer::Resource> Also known as: organization_projects
List organization projects
Requires authenticated client
52 53 54 55 |
# File 'lib/octokit/client/projects.rb', line 52 def org_projects(org, = {}) opts = ensure_api_media_type(:projects, ) get "orgs/#{org}/projects", opts end |
#project(id, options = {}) ⇒ Sawyer::Resource
Get a project by id
85 86 87 88 |
# File 'lib/octokit/client/projects.rb', line 85 def project(id, = {}) opts = ensure_api_media_type(:projects, ) get "projects/#{id}", opts end |
#project_card(id, options = {}) ⇒ Sawyer::Resource
Get a project card
Requires authenticated client
254 255 256 257 |
# File 'lib/octokit/client/projects.rb', line 254 def project_card(id, = {}) opts = ensure_api_media_type(:projects, ) get "projects/columns/cards/#{id}", opts end |
#project_column(id, options = {}) ⇒ Sawyer::Resource
Get a project column by ID
155 156 157 158 |
# File 'lib/octokit/client/projects.rb', line 155 def project_column(id, = {}) opts = ensure_api_media_type(:projects, ) get "projects/columns/#{id}", opts end |
#project_columns(id, options = {}) ⇒ Array<Sawyer::Resource>
List project columns
127 128 129 130 |
# File 'lib/octokit/client/projects.rb', line 127 def project_columns(id, = {}) opts = ensure_api_media_type(:projects, ) paginate "projects/#{id}/columns", opts end |
#projects(repo, options = {}) ⇒ Array<Sawyer::Resource>
List projects for a repository
Requires authenticated client
18 19 20 21 |
# File 'lib/octokit/client/projects.rb', line 18 def projects(repo, = {}) opts = ensure_api_media_type(:projects, ) paginate "#{Repository.path repo}/projects", opts end |
#update_project(id, options = {}) ⇒ Sawyer::Resource
Update a project
Requires authenticated client
101 102 103 104 |
# File 'lib/octokit/client/projects.rb', line 101 def update_project(id, = {}) opts = ensure_api_media_type(:projects, ) patch "projects/#{id}", opts end |
#update_project_card(id, options = {}) ⇒ Sawyer::Resource
Update a project card
Requires authenticated client
271 272 273 274 |
# File 'lib/octokit/client/projects.rb', line 271 def update_project_card(id, = {}) opts = ensure_api_media_type(:projects, ) patch "projects/columns/cards/#{id}", opts end |
#update_project_column(id, name, options = {}) ⇒ Sawyer::Resource
Update a project column
Requires authenticated client
170 171 172 173 174 |
# File 'lib/octokit/client/projects.rb', line 170 def update_project_column(id, name, = {}) opts = ensure_api_media_type(:projects, ) opts[:name] = name patch "projects/columns/#{id}", opts end |