Skip to content

Commit

Permalink
Merge pull request #139 from Asana/openapi-sync
Browse files Browse the repository at this point in the history
Generated from OpenAPI
  • Loading branch information
aw-asana authored Jun 30, 2022
2 parents cdb6915 + e4891e9 commit ae66d87
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 65 deletions.
13 changes: 7 additions & 6 deletions lib/asana/resources/gen/attachments_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@ def get_attachment(client, attachment_gid: required("attachment_gid"), options:
Attachment.new(parse(client.get(path, options: options)).first, client: client)
end

# Get attachments for a task
# Get attachments from an object
#
# task_gid - [str] (required) The task to operate on.

# parent - [str] (required) Globally unique identifier for object to fetch statuses from. Must be a GID for a task or project_brief.
# 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_attachments_for_task(client, task_gid: required("task_gid"), options: {})
path = "/tasks/{task_gid}/attachments"
path["{task_gid}"] = task_gid
Collection.new(parse(client.get(path, options: options)), type: Attachment, client: client)
def get_attachments_for_object(client, parent: nil, options: {})
path = "/attachments"
params = { parent: parent }.reject { |_,v| v.nil? || Array(v).empty? }
Collection.new(parse(client.get(path, params: params, options: options)), type: Attachment, client: client)
end

end
Expand Down
55 changes: 33 additions & 22 deletions lib/asana/resources/gen/goals_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,40 @@ def self.inherited(base)
class << self
# Add a collaborator to a goal
#

# goal_gid - [str] (required) Globally unique identifier for the goal.
# 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 add_followers(client, options: {}, **data)
def add_followers(client, goal_gid: required("goal_gid"), options: {}, **data)
path = "/goals/{goal_gid}/addFollowers"
path["{goal_gid}"] = goal_gid
parse(client.post(path, body: data, options: options)).first
end

# Add a subgoal to a parent goal
#

# goal_gid - [str] (required) Globally unique identifier for the goal.
# 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 add_subgoal(client, options: {}, **data)
def add_subgoal(client, goal_gid: required("goal_gid"), options: {}, **data)
path = "/goals/{goal_gid}/addSubgoal"
path["{goal_gid}"] = goal_gid
parse(client.post(path, body: data, options: options)).first
end

# Add a project/portfolio as supporting work for a goal.
#

# goal_gid - [str] (required) Globally unique identifier for the goal.
# 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 add_supporting_work_for_goal(client, options: {}, **data)
def add_supporting_work_for_goal(client, goal_gid: required("goal_gid"), options: {}, **data)
path = "/goals/{goal_gid}/addSupportingWork"
path["{goal_gid}"] = goal_gid
parse(client.post(path, body: data, options: options)).first
end

Expand All @@ -64,13 +67,14 @@ def create_goal(client, options: {}, **data)

# Create a goal metric
#

# goal_gid - [str] (required) Globally unique identifier for the goal.
# 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 create_goal_metric(client, options: {}, **data)
def create_goal_metric(client, goal_gid: required("goal_gid"), options: {}, **data)
path = "/goals/{goal_gid}/setMetric"
path["{goal_gid}"] = goal_gid
parse(client.post(path, body: data, options: options)).first
end

Expand Down Expand Up @@ -120,70 +124,76 @@ def get_goals(client, portfolio: nil, project: nil, is_workspace_level: nil, tea

# Get parent goals from a goal
#

# goal_gid - [str] (required) Globally unique identifier for the goal.
# 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_parent_goals_for_goal(client, options: {})
def get_parent_goals_for_goal(client, goal_gid: required("goal_gid"), options: {})
path = "/goals/{goal_gid}/parentGoals"
path["{goal_gid}"] = goal_gid
Collection.new(parse(client.get(path, options: options)), type: Resource, client: client)
end

# Get subgoals from a goal
#

# goal_gid - [str] (required) Globally unique identifier for the goal.
# 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_subgoals_for_goal(client, options: {})
def get_subgoals_for_goal(client, goal_gid: required("goal_gid"), options: {})
path = "/goals/{goal_gid}/subgoals"
path["{goal_gid}"] = goal_gid
Collection.new(parse(client.get(path, options: options)), type: Resource, client: client)
end

# Remove a collaborator from a goal
#

# goal_gid - [str] (required) Globally unique identifier for the goal.
# 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 remove_followers(client, options: {}, **data)
def remove_followers(client, goal_gid: required("goal_gid"), options: {}, **data)
path = "/goals/{goal_gid}/removeFollowers"
path["{goal_gid}"] = goal_gid
parse(client.post(path, body: data, options: options)).first
end

# Remove a subgoal from a goal
#

# goal_gid - [str] (required) Globally unique identifier for the goal.
# 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 remove_subgoal(client, options: {}, **data)
def remove_subgoal(client, goal_gid: required("goal_gid"), options: {}, **data)
path = "/goals/{goal_gid}/removeSubgoal"
path["{goal_gid}"] = goal_gid
parse(client.post(path, body: data, options: options)).first
end

# Remove a project/portfolio as supporting work for a goal.
#

# goal_gid - [str] (required) Globally unique identifier for the goal.
# 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 remove_supporting_work_for_goal(client, options: {}, **data)
def remove_supporting_work_for_goal(client, goal_gid: required("goal_gid"), options: {}, **data)
path = "/goals/{goal_gid}/removeSupportingWork"
path["{goal_gid}"] = goal_gid
parse(client.post(path, body: data, options: options)).first
end

# Get supporting work from a goal
#

# goal_gid - [str] (required) Globally unique identifier for the goal.
# 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 supporting_work(client, options: {})
def supporting_work(client, goal_gid: required("goal_gid"), options: {})
path = "/goals/{goal_gid}/supportingWork"
path["{goal_gid}"] = goal_gid
Collection.new(parse(client.get(path, options: options)), type: Project, client: client)
end

Expand All @@ -202,13 +212,14 @@ def update_goal(client, goal_gid: required("goal_gid"), options: {}, **data)

# Update a goal metric
#

# goal_gid - [str] (required) Globally unique identifier for the goal.
# 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 update_goal_metric(client, options: {}, **data)
def update_goal_metric(client, goal_gid: required("goal_gid"), options: {}, **data)
path = "/goals/{goal_gid}/setMetricCurrentValue"
path["{goal_gid}"] = goal_gid
parse(client.post(path, body: data, options: options)).first
end

Expand Down
2 changes: 1 addition & 1 deletion lib/asana/resources/gen/status_updates_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_status(client, status_gid: required("status_gid"), options: {})
# Get status updates from an object
#

# parent - [str] (required) Globally unique identifier for object to fetch statuses from.
# parent - [str] (required) Globally unique identifier for object to fetch statuses from. Must be a GID for a project, portfolio, or goal.
# created_since - [datetime] Only return statuses that have been created since the given time.
# 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.'
Expand Down
Loading

0 comments on commit ae66d87

Please sign in to comment.