Class: Asana::Resources::ProjectTemplatesBase
- Defined in:
- lib/asana/resources/gen/project_templates_base.rb
Direct Known Subclasses
Class Method Summary collapse
-
.get_project_template(client, project_template_gid: required("project_template_gid"), options: {}) ⇒ Object
Get a project template.
-
.get_project_templates(client, workspace: nil, team: nil, options: {}) ⇒ Object
workspace - [str] The workspace to filter results on.
-
.get_project_templates_for_team(client, team_gid: required("team_gid"), options: {}) ⇒ Object
Get a team’s project templates.
- .inherited(base) ⇒ Object
-
.instantiate_project(client, project_template_gid: required("project_template_gid"), options: {}, **data) ⇒ Object
Instantiate a project from a project template.
Methods inherited from Resource
#initialize, #method_missing, #refresh, #respond_to_missing?, #to_h, #to_s
Methods included from ResponseHelper
Constructor Details
This class inherits a constructor from Asana::Resources::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Asana::Resources::Resource
Class Method Details
.get_project_template(client, project_template_gid: required("project_template_gid"), options: {}) ⇒ Object
Get a project template
21 22 23 24 25 |
# File 'lib/asana/resources/gen/project_templates_base.rb', line 21 def get_project_template(client, project_template_gid: required("project_template_gid"), options: {}) path = "/project_templates/{project_template_gid}" path["{project_template_gid}"] = project_template_gid parse(client.get(path, options: )).first end |
.get_project_templates(client, workspace: nil, team: nil, options: {}) ⇒ Object
workspace - [str] The workspace to filter results on.
37 38 39 40 41 |
# File 'lib/asana/resources/gen/project_templates_base.rb', line 37 def get_project_templates(client, workspace: nil, team: nil, options: {}) path = "/project_templates" params = { workspace: workspace, team: team }.reject { |_,v| v.nil? || Array(v).empty? } Collection.new(parse(client.get(path, params: params, options: )), type: Resource, client: client) end |
.get_project_templates_for_team(client, team_gid: required("team_gid"), options: {}) ⇒ Object
Get a team’s project templates
51 52 53 54 55 |
# File 'lib/asana/resources/gen/project_templates_base.rb', line 51 def get_project_templates_for_team(client, team_gid: required("team_gid"), options: {}) path = "/teams/{team_gid}/project_templates" path["{team_gid}"] = team_gid Collection.new(parse(client.get(path, options: )), type: Resource, client: client) end |
.inherited(base) ⇒ Object
10 11 12 |
# File 'lib/asana/resources/gen/project_templates_base.rb', line 10 def self.inherited(base) Registry.register(base) end |
.instantiate_project(client, project_template_gid: required("project_template_gid"), options: {}, **data) ⇒ Object
Instantiate a project from a project template
64 65 66 67 68 |
# File 'lib/asana/resources/gen/project_templates_base.rb', line 64 def instantiate_project(client, project_template_gid: required("project_template_gid"), options: {}, **data) path = "/project_templates/{project_template_gid}/instantiateProject" path["{project_template_gid}"] = project_template_gid Job.new(parse(client.post(path, body: data, options: )).first, client: client) end |