Module: FileboundClient::Endpoints::Projects
- Defined in:
- lib/filebound_client/endpoints/projects.rb
Overview
Module for Projects resource endpoint
Class Method Summary collapse
-
.included(klass) ⇒ Object
This will call macros to create resource methods on the fly.
Instance Method Summary collapse
-
#project(project_id, query_params = nil) ⇒ Project
Retrieves a single project by its key.
-
#project_add(project) ⇒ int
Adds a project.
-
#project_assignments(project_id, query_params = nil) ⇒ Array
Retrieves assignments for a project.
-
#project_delete(project_id) ⇒ bool
Deletes a project.
-
#project_divider_add(project_id, divider) ⇒ int
Adds a divider to a project.
-
#project_dividers(project_id, query_params = nil) ⇒ Array
Retrieves dividers for a project.
-
#project_fields(project_id, query_params = nil) ⇒ Array
Retrieves fields for a project.
-
#project_file_add(project_id, file) ⇒ int
Adds a file to a project.
-
#project_files(project_id, query_params = nil) ⇒ Array
Retrieves files for a project.
-
#project_files_add(project_id, files) ⇒ Hash
Adds an array of files to a project.
-
#project_groups(project_id, query_params = nil) ⇒ Array
Retrieves groups for a project.
-
#project_routeditems(project_id, query_params = nil) ⇒ Array
Retrieves routed items for a project.
-
#project_routes(project_id, query_params = nil) ⇒ Array
Retrieves routes for a project.
-
#project_separator_add(project_id, separator) ⇒ int
Adds a separator to a project.
-
#project_separators(project_id, query_params = nil) ⇒ Array
Retrieves separators for a project.
-
#project_update(project) ⇒ int
Edits a project.
Class Method Details
.included(klass) ⇒ Object
This will call macros to create resource methods on the fly
6 7 8 9 10 11 |
# File 'lib/filebound_client/endpoints/projects.rb', line 6 def self.included(klass) klass.instance_eval do allow_new :project allow_all :projects end end |
Instance Method Details
#project(project_id, query_params = nil) ⇒ Project
Retrieves a single project by its key
17 18 19 |
# File 'lib/filebound_client/endpoints/projects.rb', line 17 def project(project_id, query_params = nil) get("/projects/#{project_id}", query_params) end |
#project_add(project) ⇒ int
Adds a project. The project.ProjectId must be nil or 0.
96 97 98 99 |
# File 'lib/filebound_client/endpoints/projects.rb', line 96 def project_add(project) raise Client::FileboundClientException.new('Id is required', 0) if project[:projectId].greater_than_zero? put('/projects', nil, project) end |
#project_assignments(project_id, query_params = nil) ⇒ Array
Retrieves assignments for a project
75 76 77 |
# File 'lib/filebound_client/endpoints/projects.rb', line 75 def project_assignments(project_id, query_params = nil) get_project_children(project_id, __method__, query_params) end |
#project_delete(project_id) ⇒ bool
Deletes a project
149 150 151 |
# File 'lib/filebound_client/endpoints/projects.rb', line 149 def project_delete(project_id) delete("/projects/#{project_id}") end |
#project_divider_add(project_id, divider) ⇒ int
Adds a divider to a project
118 119 120 |
# File 'lib/filebound_client/endpoints/projects.rb', line 118 def project_divider_add(project_id, divider) put("/projects/#{project_id}/dividers", nil, divider) end |
#project_dividers(project_id, query_params = nil) ⇒ Array
Retrieves dividers for a project
50 51 52 |
# File 'lib/filebound_client/endpoints/projects.rb', line 50 def project_dividers(project_id, query_params = nil) get_project_children(project_id, __method__, query_params) end |
#project_fields(project_id, query_params = nil) ⇒ Array
Retrieves fields for a project
26 27 28 |
# File 'lib/filebound_client/endpoints/projects.rb', line 26 def project_fields(project_id, query_params = nil) get_project_children(project_id, __method__, query_params) end |
#project_file_add(project_id, file) ⇒ int
Adds a file to a project
134 135 136 |
# File 'lib/filebound_client/endpoints/projects.rb', line 134 def project_file_add(project_id, file) put("/projects/#{project_id}/files", nil, file) end |
#project_files(project_id, query_params = nil) ⇒ Array
Retrieves files for a project
34 35 36 |
# File 'lib/filebound_client/endpoints/projects.rb', line 34 def project_files(project_id, query_params = nil) get_project_children(project_id, __method__, query_params) end |
#project_files_add(project_id, files) ⇒ Hash
Adds an array of files to a project
142 143 144 |
# File 'lib/filebound_client/endpoints/projects.rb', line 142 def project_files_add(project_id, files) put("/projects/#{project_id}/listfiles", nil, files) end |
#project_groups(project_id, query_params = nil) ⇒ Array
Retrieves groups for a project
42 43 44 |
# File 'lib/filebound_client/endpoints/projects.rb', line 42 def project_groups(project_id, query_params = nil) get_project_children(project_id, __method__, query_params) end |
#project_routeditems(project_id, query_params = nil) ⇒ Array
Retrieves routed items for a project
59 60 61 |
# File 'lib/filebound_client/endpoints/projects.rb', line 59 def project_routeditems(project_id, query_params = nil) get_project_children(project_id, __method__, query_params) end |
#project_routes(project_id, query_params = nil) ⇒ Array
Retrieves routes for a project
84 85 86 |
# File 'lib/filebound_client/endpoints/projects.rb', line 84 def project_routes(project_id, query_params = nil) get_project_children(project_id, __method__, query_params) end |
#project_separator_add(project_id, separator) ⇒ int
Adds a separator to a project
126 127 128 |
# File 'lib/filebound_client/endpoints/projects.rb', line 126 def project_separator_add(project_id, separator) put("/projects/#{project_id}/separators", nil, separator) end |
#project_separators(project_id, query_params = nil) ⇒ Array
Retrieves separators for a project
67 68 69 |
# File 'lib/filebound_client/endpoints/projects.rb', line 67 def project_separators(project_id, query_params = nil) get_project_children(project_id, __method__, query_params) end |
#project_update(project) ⇒ int
Edits a project. The project.ProjectId must be not nil and > 0.
109 110 111 112 |
# File 'lib/filebound_client/endpoints/projects.rb', line 109 def project_update(project) raise Client::FileboundClientException.new('Id is required', 0) unless project[:projectId].greater_than_zero? put('/projects', nil, project) end |