Class: Asana::Resources::OrganizationExport
- Inherits:
-
OrganizationExportsBase
- Object
- Resource
- OrganizationExportsBase
- Asana::Resources::OrganizationExport
- Defined in:
- lib/asana/resources/organization_export.rb
Overview
An organization_export object represents a request to export the complete data of an Organization in JSON format.
To export an Organization using this API:
-
Create an ‘organization_export` [request](#create) and store the id that is returned.\
-
Request the ‘organization_export` every few minutes, until the `state` field contains ’finished’.\
-
Download the file located at the URL in the ‘download_url` field.
Exports can take a long time, from several minutes to a few hours for large Organizations.
Note: These endpoints are only available to [Service Accounts](/guide/help/premium/service-accounts) of an [Enterprise](/enterprise) Organization.
Instance Attribute Summary collapse
- #created_at ⇒ Object readonly
- #download_url ⇒ Object readonly
- #gid ⇒ Object readonly
- #organization ⇒ Object readonly
- #state ⇒ Object readonly
Class Method Summary collapse
-
.create(client, organization: required("organization"), options: {}, **data) ⇒ Object
This method creates a request to export an Organization.
-
.find_by_id(client, id, options: {}) ⇒ Object
Returns details of a previously-requested Organization export.
-
.plural_name ⇒ Object
Returns the plural name of the resource.
Methods inherited from OrganizationExportsBase
create_organization_export, get_organization_export, inherited
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
Instance Attribute Details
#created_at ⇒ Object (readonly)
23 24 25 |
# File 'lib/asana/resources/organization_export.rb', line 23 def created_at @created_at end |
#download_url ⇒ Object (readonly)
25 26 27 |
# File 'lib/asana/resources/organization_export.rb', line 25 def download_url @download_url end |
#gid ⇒ Object (readonly)
21 22 23 |
# File 'lib/asana/resources/organization_export.rb', line 21 def gid @gid end |
#organization ⇒ Object (readonly)
29 30 31 |
# File 'lib/asana/resources/organization_export.rb', line 29 def organization @organization end |
#state ⇒ Object (readonly)
27 28 29 |
# File 'lib/asana/resources/organization_export.rb', line 27 def state @state end |
Class Method Details
.create(client, organization: required("organization"), options: {}, **data) ⇒ Object
This method creates a request to export an Organization. Asana will complete the export at some point after you create the request.
54 55 56 57 |
# File 'lib/asana/resources/organization_export.rb', line 54 def create(client, organization: required("organization"), options: {}, **data) with_params = data.merge(organization: organization).reject { |_,v| v.nil? || Array(v).empty? } Resource.new(parse(client.post("/organization_exports", body: with_params, options: )).first, client: client) end |
.find_by_id(client, id, options: {}) ⇒ Object
Returns details of a previously-requested Organization export.
42 43 44 45 |
# File 'lib/asana/resources/organization_export.rb', line 42 def find_by_id(client, id, options: {}) self.new(parse(client.get("/organization_exports/#{id}", options: )).first, client: client) end |
.plural_name ⇒ Object
Returns the plural name of the resource.
33 34 35 |
# File 'lib/asana/resources/organization_export.rb', line 33 def plural_name 'organization_exports' end |