Skip to content

Commit

Permalink
Merge pull request #123 from Asana/openapi-sync
Browse files Browse the repository at this point in the history
Generated from OpenAPI
  • Loading branch information
jv-asana committed Mar 4, 2022
2 parents d2ba0fe + 8649138 commit 99920da
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.10
0.10.11
73 changes: 73 additions & 0 deletions lib/asana/resources/gen/project_templates_base.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
### WARNING: This file is auto-generated by our OpenAPI spec. Do not
### edit it manually.

require_relative '../../resource_includes/response_helper'

module Asana
module Resources
class ProjectTemplatesBase < Resource

def self.inherited(base)
Registry.register(base)
end

class << self
# Get a project template
#
# project_template_gid - [str] (required) Globally unique identifier for the project template.
# options - [Hash] the request I/O options
# > opt_fields - [list[str]] Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
# > opt_pretty - [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
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: options)).first
end

# Get multiple project templates
#

# workspace - [str] The workspace to filter results on.
# team - [str] The team to filter projects on.
# options - [Hash] the request I/O options
# > offset - [str] Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
# > opt_fields - [list[str]] Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
# > opt_pretty - [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
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: options)), type: Resource, client: client)
end

# Get a team's project templates
#
# team_gid - [str] (required) Globally unique identifier for the team.
# options - [Hash] the request I/O options
# > offset - [str] Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
# > opt_fields - [list[str]] Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
# > opt_pretty - [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
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: options)), type: Resource, client: client)
end

# Instantiate a project from a project template
#
# project_template_gid - [str] (required) Globally unique identifier for the project template.
# options - [Hash] the request I/O options
# > opt_fields - [list[str]] Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
# > opt_pretty - [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
# data - [Hash] the attributes to POST
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: options)).first, client: client)
end

end
end
end
end
13 changes: 13 additions & 0 deletions lib/asana/resources/gen/projects_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,19 @@ def get_task_counts_for_project(client, project_gid: required("project_gid"), op
parse(client.get(path, options: options)).first
end

# Create a project template from a project
#
# project_gid - [str] (required) Globally unique identifier for the project.
# options - [Hash] the request I/O options
# > opt_fields - [list[str]] Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
# > opt_pretty - [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
# data - [Hash] the attributes to POST
def project_save_as_template(client, project_gid: required("project_gid"), options: {}, **data)
path = "/projects/{project_gid}/saveAsTemplate"
path["{project_gid}"] = project_gid
Job.new(parse(client.post(path, body: data, options: options)).first, client: client)
end

# Remove a custom field from a project
#
# project_gid - [str] (required) Globally unique identifier for the project.
Expand Down
2 changes: 1 addition & 1 deletion lib/asana/resources/gen/typeahead_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class << self
# Get objects via typeahead
#
# workspace_gid - [str] (required) Globally unique identifier for the workspace or organization.
# resource_type - [str] (required) The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported.
# resource_type - [str] (required) The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `project_template`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported.
# type - [str] *Deprecated: new integrations should prefer the resource_type field.*
# query - [str] The string that will be used to search for relevant objects. If an empty string is passed in, the API will currently return an empty result set.
# count - [int] The number of results to return. The default is 20 if this parameter is omitted, with a minimum of 1 and a maximum of 100. If there are fewer results found than requested, all will be returned.
Expand Down
2 changes: 1 addition & 1 deletion lib/asana/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#:nodoc:
module Asana
# Public: Version of the gem.
VERSION = '0.10.10'
VERSION = '0.10.11'
end
41 changes: 41 additions & 0 deletions samples/project_templates_sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
projecttemplates:
get_project_template: >-
require 'asana'
client = Asana::Client.new do |c|
c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
end
result = client.project_templates.get_project_template(project_template_gid: 'project_template_gid', param: "value", param: "value", options: {pretty: true})
get_project_templates: >-
require 'asana'
client = Asana::Client.new do |c|
c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
end
result = client.project_templates.get_project_templates(param: "value", param: "value", options: {pretty: true})
get_project_templates_for_team: >-
require 'asana'
client = Asana::Client.new do |c|
c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
end
result = client.project_templates.get_project_templates_for_team(team_gid: 'team_gid', param: "value", param: "value", options: {pretty: true})
instantiate_project: >-
require 'asana'
client = Asana::Client.new do |c|
c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
end
result = client.project_templates.instantiate_project(project_template_gid: 'project_template_gid', field: "value", field: "value", options: {pretty: true})
10 changes: 10 additions & 0 deletions samples/projects_sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ projects:
result = client.projects.get_task_counts_for_project(project_gid: 'project_gid', param: "value", param: "value", options: {pretty: true})
project_save_as_template: >-
require 'asana'
client = Asana::Client.new do |c|
c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
end
result = client.projects.project_save_as_template(project_gid: 'project_gid', field: "value", field: "value", options: {pretty: true})
remove_custom_field_setting_for_project: >-
require 'asana'
Expand Down

0 comments on commit 99920da

Please sign in to comment.