Class: Asana::Resources::AttachmentsBase
- Defined in:
- lib/asana/resources/gen/attachments_base.rb
Direct Known Subclasses
Class Method Summary collapse
-
.delete_attachment(client, attachment_gid: required("attachment_gid"), options: {}) ⇒ Object
Delete an attachment.
-
.get_attachment(client, attachment_gid: required("attachment_gid"), options: {}) ⇒ Object
Get an attachment.
-
.get_attachments_for_object(client, parent: nil, options: {}) ⇒ Object
parent - [str] (required) Globally unique identifier for object to fetch statuses from.
- .inherited(base) ⇒ Object
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
.delete_attachment(client, attachment_gid: required("attachment_gid"), options: {}) ⇒ Object
Delete an attachment
21 22 23 24 25 |
# File 'lib/asana/resources/gen/attachments_base.rb', line 21 def (client, attachment_gid: required("attachment_gid"), options: {}) path = "/attachments/{attachment_gid}" path["{attachment_gid}"] = parse(client.delete(path, options: )).first end |
.get_attachment(client, attachment_gid: required("attachment_gid"), options: {}) ⇒ Object
Get an attachment
33 34 35 36 37 |
# File 'lib/asana/resources/gen/attachments_base.rb', line 33 def (client, attachment_gid: required("attachment_gid"), options: {}) path = "/attachments/{attachment_gid}" path["{attachment_gid}"] = Attachment.new(parse(client.get(path, options: )).first, client: client) end |
.get_attachments_for_object(client, parent: nil, options: {}) ⇒ Object
parent - [str] (required) Globally unique identifier for object to fetch statuses from. Must be a GID for a ‘project`, `project_brief`, or `task`.
48 49 50 51 52 |
# File 'lib/asana/resources/gen/attachments_base.rb', line 48 def (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: )), type: Attachment, client: client) end |