Class: Asana::Resources::TypeaheadBase

Inherits:
Resource
  • Object
show all
Defined in:
lib/asana/resources/gen/typeahead_base.rb

Direct Known Subclasses

Typeahead

Class Method Summary collapse

Methods inherited from Resource

#initialize, #method_missing, #refresh, #respond_to_missing?, #to_h, #to_s

Methods included from ResponseHelper

#parse

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

.inherited(base) ⇒ Object



10
11
12
# File 'lib/asana/resources/gen/typeahead_base.rb', line 10

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

.typeahead_for_workspace(client, workspace_gid: required("workspace_gid"), resource_type: nil, type: nil, query: nil, count: nil, options: {}) ⇒ Object

Get objects via typeahead

Parameters:

  • workspace_gid (str) (defaults to: required("workspace_gid"))

    (required) Globally unique identifier for the workspace or organization.

  • resource_type (str) (defaults to: nil)

    (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) (defaults to: nil)

    *Deprecated: new integrations should prefer the resource_type field.*

  • query (str) (defaults to: nil)

    The string that will be used to search for relevant objects. If an empty string is passed in, the API will return results.

  • count (int) (defaults to: nil)

    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.

  • options (Hash) (defaults to: {})

    the request I/O options

  • 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.

  • bool (>])

    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.



25
26
27
28
29
30
# File 'lib/asana/resources/gen/typeahead_base.rb', line 25

def typeahead_for_workspace(client, workspace_gid: required("workspace_gid"), resource_type: nil, type: nil, query: nil, count: nil, options: {})
  path = "/workspaces/{workspace_gid}/typeahead"
  path["{workspace_gid}"] = workspace_gid
  params = { resource_type: resource_type, type: type, query: query, count: count }.reject { |_,v| v.nil? || Array(v).empty? }
  Collection.new(parse(client.get(path, params: params, options: options)), type: Resource, client: client)
end