class Asana::Resources::PortfoliosBase

Public Class Methods

add_custom_field_setting_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data) click to toggle source

Add a custom field to a portfolio

portfolio_gid - [str] (required) Globally unique identifier for the portfolio. options - [Hash] the request I/O 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

# File lib/asana/resources/gen/portfolios_base.rb, line 21
def add_custom_field_setting_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data)
  path = "/portfolios/{portfolio_gid}/addCustomFieldSetting"
  path["{portfolio_gid}"] = portfolio_gid
  parse(client.post(path, body: data, options: options)).first
end
add_item_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data) click to toggle source

Add a portfolio item

portfolio_gid - [str] (required) Globally unique identifier for the portfolio. options - [Hash] the request I/O options > opt_fields - [list] 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

# File lib/asana/resources/gen/portfolios_base.rb, line 34
def add_item_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data)
  path = "/portfolios/{portfolio_gid}/addItem"
  path["{portfolio_gid}"] = portfolio_gid
  parse(client.post(path, body: data, options: options)).first
end
add_members_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data) click to toggle source

Add users to a portfolio

portfolio_gid - [str] (required) Globally unique identifier for the portfolio. options - [Hash] the request I/O options > opt_fields - [list] 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

# File lib/asana/resources/gen/portfolios_base.rb, line 47
def add_members_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data)
  path = "/portfolios/{portfolio_gid}/addMembers"
  path["{portfolio_gid}"] = portfolio_gid
  parse(client.post(path, body: data, options: options)).first
end
create_portfolio(client, options: {}, **data) click to toggle source

options - [Hash] the request I/O options > opt_fields - [list] 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

# File lib/asana/resources/gen/portfolios_base.rb, line 60
def create_portfolio(client, options: {}, **data)
  path = "/portfolios"
  Portfolio.new(parse(client.post(path, body: data, options: options)).first, client: client)
end
delete_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}) click to toggle source

Delete a portfolio

portfolio_gid - [str] (required) Globally unique identifier for the portfolio. options - [Hash] the request I/O options > opt_fields - [list] 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.

# File lib/asana/resources/gen/portfolios_base.rb, line 71
def delete_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {})
  path = "/portfolios/{portfolio_gid}"
  path["{portfolio_gid}"] = portfolio_gid
  parse(client.delete(path, options: options)).first
end
get_items_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}) click to toggle source

Get portfolio items

portfolio_gid - [str] (required) Globally unique identifier for the portfolio. 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] 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.

# File lib/asana/resources/gen/portfolios_base.rb, line 85
def get_items_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {})
  path = "/portfolios/{portfolio_gid}/items"
  path["{portfolio_gid}"] = portfolio_gid
  Collection.new(parse(client.get(path, options: options)), type: Project, client: client)
end
get_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}) click to toggle source

Get a portfolio

portfolio_gid - [str] (required) Globally unique identifier for the portfolio. options - [Hash] the request I/O options > opt_fields - [list] 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.

# File lib/asana/resources/gen/portfolios_base.rb, line 97
def get_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {})
  path = "/portfolios/{portfolio_gid}"
  path["{portfolio_gid}"] = portfolio_gid
  Portfolio.new(parse(client.get(path, options: options)).first, client: client)
end
get_portfolios(client, workspace: nil, owner: nil, options: {}) click to toggle source

workspace - [str] (required) The workspace or organization to filter portfolios on. owner - [str] (required) The user who owns the portfolio. Currently, API users can only get a list of portfolios that they themselves own. 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] 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.

# File lib/asana/resources/gen/portfolios_base.rb, line 113
def get_portfolios(client, workspace: nil, owner: nil, options: {})
  path = "/portfolios"
  params = { workspace: workspace, owner: owner }.reject { |_,v| v.nil? || Array(v).empty? }
  Collection.new(parse(client.get(path, params: params, options: options)), type: Portfolio, client: client)
end
inherited(base) click to toggle source
# File lib/asana/resources/gen/portfolios_base.rb, line 10
def self.inherited(base)
  Registry.register(base)
end
remove_custom_field_setting_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data) click to toggle source

Remove a custom field from a portfolio

portfolio_gid - [str] (required) Globally unique identifier for the portfolio. options - [Hash] the request I/O 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

# File lib/asana/resources/gen/portfolios_base.rb, line 125
def remove_custom_field_setting_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data)
  path = "/portfolios/{portfolio_gid}/removeCustomFieldSetting"
  path["{portfolio_gid}"] = portfolio_gid
  parse(client.post(path, body: data, options: options)).first
end
remove_item_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data) click to toggle source

Remove a portfolio item

portfolio_gid - [str] (required) Globally unique identifier for the portfolio. options - [Hash] the request I/O options > opt_fields - [list] 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

# File lib/asana/resources/gen/portfolios_base.rb, line 138
def remove_item_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data)
  path = "/portfolios/{portfolio_gid}/removeItem"
  path["{portfolio_gid}"] = portfolio_gid
  parse(client.post(path, body: data, options: options)).first
end
remove_members_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data) click to toggle source

Remove users from a portfolio

portfolio_gid - [str] (required) Globally unique identifier for the portfolio. options - [Hash] the request I/O options > opt_fields - [list] 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

# File lib/asana/resources/gen/portfolios_base.rb, line 151
def remove_members_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data)
  path = "/portfolios/{portfolio_gid}/removeMembers"
  path["{portfolio_gid}"] = portfolio_gid
  parse(client.post(path, body: data, options: options)).first
end
update_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data) click to toggle source

Update a portfolio

portfolio_gid - [str] (required) Globally unique identifier for the portfolio. options - [Hash] the request I/O options > opt_fields - [list] 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 PUT

# File lib/asana/resources/gen/portfolios_base.rb, line 164
def update_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data)
  path = "/portfolios/{portfolio_gid}"
  path["{portfolio_gid}"] = portfolio_gid
  Portfolio.new(parse(client.put(path, body: data, options: options)).first, client: client)
end