asana 0.9.3 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.swagger-codegen-ignore +3 -0
  3. data/.travis.yml +2 -1
  4. data/Appraisals +2 -35
  5. data/Gemfile +2 -0
  6. data/README.md +3 -51
  7. data/VERSION +1 -0
  8. data/asana.gemspec +3 -3
  9. data/examples/Gemfile.lock +10 -10
  10. data/lib/asana/client.rb +10 -10
  11. data/lib/asana/http_client.rb +8 -2
  12. data/lib/asana/resource_includes/attachment_uploading.rb +14 -7
  13. data/lib/asana/resource_includes/collection.rb +5 -0
  14. data/lib/asana/resource_includes/resource.rb +0 -4
  15. data/lib/asana/resources/attachment.rb +2 -5
  16. data/lib/asana/resources/batch_api.rb +15 -0
  17. data/lib/asana/resources/custom_field_settings.rb +2 -5
  18. data/lib/asana/resources/custom_fields.rb +2 -5
  19. data/lib/asana/resources/events.rb +28 -0
  20. data/lib/asana/resources/gen/attachments_base.rb +56 -0
  21. data/lib/asana/resources/gen/batch_api_base.rb +30 -0
  22. data/lib/asana/resources/gen/custom_field_settings_base.rb +46 -0
  23. data/lib/asana/resources/gen/custom_fields_base.rb +124 -0
  24. data/lib/asana/resources/gen/events_base.rb +32 -0
  25. data/lib/asana/resources/gen/jobs_base.rb +30 -0
  26. data/lib/asana/resources/gen/organization_exports_base.rb +44 -0
  27. data/lib/asana/resources/gen/portfolio_memberships_base.rb +63 -0
  28. data/lib/asana/resources/gen/portfolios_base.rb +173 -0
  29. data/lib/asana/resources/gen/project_memberships_base.rb +46 -0
  30. data/lib/asana/resources/gen/project_statuses_base.rb +69 -0
  31. data/lib/asana/resources/gen/projects_base.rb +259 -0
  32. data/lib/asana/resources/gen/sections_base.rb +108 -0
  33. data/lib/asana/resources/gen/stories_base.rb +84 -0
  34. data/lib/asana/resources/gen/tags_base.rb +129 -0
  35. data/lib/asana/resources/gen/tasks_base.rb +425 -0
  36. data/lib/asana/resources/gen/team_memberships_base.rb +77 -0
  37. data/lib/asana/resources/gen/teams_base.rb +88 -0
  38. data/lib/asana/resources/gen/typeahead_base.rb +35 -0
  39. data/lib/asana/resources/gen/user_task_lists_base.rb +44 -0
  40. data/lib/asana/resources/gen/users_base.rb +88 -0
  41. data/lib/asana/resources/gen/webhooks_base.rb +70 -0
  42. data/lib/asana/resources/gen/workspace_memberships_base.rb +60 -0
  43. data/lib/asana/resources/gen/workspaces_base.rb +82 -0
  44. data/lib/asana/resources/job.rb +2 -3
  45. data/lib/asana/resources/organization_export.rb +2 -5
  46. data/lib/asana/resources/portfolio.rb +2 -5
  47. data/lib/asana/resources/portfolio_membership.rb +2 -5
  48. data/lib/asana/resources/project.rb +2 -5
  49. data/lib/asana/resources/project_membership.rb +2 -5
  50. data/lib/asana/resources/project_status.rb +2 -5
  51. data/lib/asana/resources/section.rb +18 -22
  52. data/lib/asana/resources/story.rb +2 -5
  53. data/lib/asana/resources/tag.rb +2 -5
  54. data/lib/asana/resources/task.rb +2 -5
  55. data/lib/asana/resources/team.rb +2 -5
  56. data/lib/asana/resources/team_membership.rb +26 -0
  57. data/lib/asana/resources/typeahead.rb +22 -0
  58. data/lib/asana/resources/user.rb +2 -5
  59. data/lib/asana/resources/user_task_list.rb +2 -5
  60. data/lib/asana/resources/webhook.rb +2 -5
  61. data/lib/asana/resources/workspace.rb +2 -6
  62. data/lib/asana/resources/workspace_membership.rb +32 -0
  63. data/lib/asana/version.rb +1 -1
  64. data/samples/attachments_sample.yaml +41 -0
  65. data/samples/batch_api_sample.yaml +11 -0
  66. data/samples/custom_field_settings_sample.yaml +21 -0
  67. data/samples/custom_fields_sample.yaml +81 -0
  68. data/samples/events_sample.yaml +11 -0
  69. data/samples/jobs_sample.yaml +11 -0
  70. data/samples/organization_exports_sample.yaml +21 -0
  71. data/samples/portfolio_memberships_sample.yaml +31 -0
  72. data/samples/portfolios_sample.yaml +121 -0
  73. data/samples/project_memberships_sample.yaml +21 -0
  74. data/samples/project_statuses_sample.yaml +41 -0
  75. data/samples/projects_sample.yaml +181 -0
  76. data/samples/sections_sample.yaml +71 -0
  77. data/samples/stories_sample.yaml +51 -0
  78. data/samples/tags_sample.yaml +81 -0
  79. data/samples/tasks_sample.yaml +261 -0
  80. data/samples/team_memberships_sample.yaml +41 -0
  81. data/samples/teams_sample.yaml +51 -0
  82. data/samples/typeahead_sample.yaml +11 -0
  83. data/samples/user_task_lists_sample.yaml +21 -0
  84. data/samples/users_sample.yaml +51 -0
  85. data/samples/webhooks_sample.yaml +41 -0
  86. data/samples/workspace_memberships_sample.yaml +31 -0
  87. data/samples/workspaces_sample.yaml +51 -0
  88. data/swagger_templates/api.mustache +41 -0
  89. data/swagger_templates/api_doc.mustache +12 -0
  90. data/swagger_templates/ruby-config.json +6 -0
  91. metadata +70 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7e067666054f042bfbbc6c06ba9dc0097be619f6091ee77e4c2cfb8667deead
4
- data.tar.gz: 44858543741b3d8c5e421159eb0c170f830299eea6c8897cc91e61149a2adce5
3
+ metadata.gz: 7cbc517a0b8e45655043ff4ac2a419f12be72db5a12cb6efc5e80c29b13ab64e
4
+ data.tar.gz: ce52a082b48c060ca9f0d82c01534451c8a4f0417c745cfd40a71ae72f157944
5
5
  SHA512:
6
- metadata.gz: 2fcac1831ce273584e5c486793d56fe9c671ef5244d316cd41b3b5092e61c1593c9e47447653237a69e30225908e27f8842a0a5e318fdabbcfd5760e2fe62d4c
7
- data.tar.gz: bec2326ce354996184af94806f8da9bf6120fa0f4c3d17c9f494f8d635a2010214c8a2e2e80c200423e73af449cd3799e73499cf93b23b5143a434f70c4a0a44
6
+ metadata.gz: b04794c205e810df61ae3e97b66c5b17671f5a0ab0843ba2a53d72aa3ed6904c2cc75a9142a517c86831de681c4f77278b1189cfd3f997c09bbd53802dce7e73
7
+ data.tar.gz: fabf06e3ccd2ea24f09daf62597db360b56b4d666e89d214f793fcaa9159a29a16f0f68cfdbd67fab587b0e0ecc9a1ef6cec8bc86b37617ac56473f6fa51e4b9
@@ -0,0 +1,3 @@
1
+ # Swagger Codegen Ignore
2
+
3
+ test/*
data/.travis.yml CHANGED
@@ -1,9 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.9
4
3
  - 2.3.6
5
4
  - 2.4.3
6
5
  - 2.5.0
6
+ - 2.7.1
7
+ - 3.0.0
7
8
  deploy:
8
9
  provider: rubygems
9
10
  api_key:
data/Appraisals CHANGED
@@ -1,37 +1,4 @@
1
1
 
2
- appraise "faraday-0.9.0" do
3
- gem "faraday", "0.9.0"
2
+ appraise "faraday-1.0.0" do
3
+ gem "faraday", "1.0.0"
4
4
  end
5
-
6
- appraise "faraday-0.9.1" do
7
- gem "faraday", "0.9.1"
8
- end
9
-
10
- appraise "faraday-0.9.2" do
11
- gem "faraday", "0.9.2"
12
- end
13
-
14
- appraise "faraday-0.10.0" do
15
- gem "faraday", "0.10.0"
16
- end
17
- appraise "faraday-0.10.1" do
18
- gem "faraday", "0.10.1"
19
- end
20
-
21
- appraise "faraday-0.11.0" do
22
- gem "faraday", "0.11.0"
23
- end
24
-
25
- # Oauth2 does not yet support 0.12
26
-
27
- # appraise "faraday-0.12.0" do
28
- # gem "faraday", "0.12.0"
29
- # end
30
- #
31
- # appraise "faraday-0.12.0.1" do
32
- # gem "faraday", "0.12.0.1"
33
- # end
34
- #
35
- # appraise "faraday-0.12.1" do
36
- # gem "faraday", "0.12.1"
37
- # end
data/Gemfile CHANGED
@@ -23,4 +23,6 @@ group :tools do
23
23
  gem 'byebug'
24
24
 
25
25
  gem 'simplecov', require: false
26
+
27
+ gem "rack-protection", "1.5.5"
26
28
  end
data/README.md CHANGED
@@ -11,53 +11,6 @@ Supported rubies:
11
11
 
12
12
  * MRI 2.0.0 up to 2.2.x stable
13
13
 
14
- ## Required: Security procedures for outdated OpenSSL versions
15
-
16
- Older versions of OpenSSL can cause a problem when using `ruby-asana` In particular, at the time of this writing, at least **MacOS X 10.11 and below** ship with a very old version of OpenSSL:
17
-
18
- $ openssl version
19
- OpenSSL 0.9.8zh 14 Jan 2016
20
-
21
- OpenSSL 0.9.8 was first released in 2005, and therefore only supports TLS (Transport Layer Security) version 1.0. Asana has deprecated and stopped accepting requests for clients which do not suport [TLS 1.0 and above](https://asa.na/tls), which unfortunately includes any software linked against this version of the library - this includes both the MacOS X provided Ruby interpreter and any homebrew installed Ruby that is not specifically configured to link against a newer version.
22
-
23
- To see if your Ruby version is affected, run
24
-
25
- $ ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
26
-
27
- If the version printed at the command line is older than `1.0.1`, when, in 2012, OpenSSL first supported TLS 1.1 and 1.2, you will not be able to use `ruby-asana` to connect to Asana. Specifically, you will recieve `400 Bad Request` responses with an error message in the response body about the lack of support for TLS 1.1 and above.
28
-
29
- Asana highly recommends using a Ruby installation manager, either RVM or `rbenv`. Instructions on how to install an up-to-date `ruby` for each of these are below.
30
-
31
- ### Solution when using RVM
32
-
33
- RVM makes it easy to install both an updated OpenSSL and a Ruby interpreter that links to it. If you are using MacPorts or Homebrew, you're probably fine out of the box; RVM favors package management using either one of these to satisfy dependencies, and so can keep your ruby up to date automatically. If you are not using these, consider using them, as they're very simple to install and use.
34
-
35
- If you don't use your package manager, you can use RVM's [package manager](https://rvm.io/packages) to install from source.
36
-
37
- If you want to build OpenSSL from source yourself, you have to specify how to link to this OpenSSL installation:
38
-
39
- $ rvm install ruby-{version} --with-openssl-dir={ssl_dir}
40
- # Specify your openssl path prefix, wherever openssl dirs
41
- # "bin", "include", and "lib" are installed; usually
42
- # "/usr" for system installs, or $PREFIX for configure/make locally.
43
- $ ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION' # Verify inside Ruby
44
- OpenSSL 1.0.2h 3 May 2016
45
-
46
- If you see the version of OpenSSL greater than OpenSSL 1.0.1, then you're all set to start using `ruby-asana`
47
-
48
- ### Solution when using rbenv
49
-
50
- Similar to RVM, rbenv compiles rubies with knowledge of MacPorts and Homebrew libraries. When a newer version of OpenSSL is installed via the method above, all rubies built (after that time of course) will link to the newer version of OpenSSL.
51
-
52
- If you don't use a package manager, as above, you can build by explicitly supplying the directory in which to find OpenSSL:
53
-
54
- $ RUBY_CONFIGURE_OPTS=--with-openssl-dir=/opt/local rbenv install ruby-{version}
55
- # Specify your openssl path prefix, wherever openssl dirs
56
- # "bin", "include", and "lib" are installed; usually
57
- # "/usr" for system installs, or $PREFIX for configure/make locally.
58
- $ ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION' # Verify inside Ruby
59
- OpenSSL 1.0.2h 3 May 2016
60
-
61
14
  ## Gem Installation
62
15
  Add this line to your application's Gemfile:
63
16
 
@@ -402,8 +355,7 @@ If you wish to make changes on the code generation script:
402
355
  spec/templates/unicorn_spec.rb`
403
356
 
404
357
  Once you're sure your code works, submit a pull request and ask the maintainer
405
- to make a release, as they'll need to run a release script from the
406
- [asana-api-meta][meta] repository.
358
+ to make a release, as they'll need to run a release script.
407
359
 
408
360
  ## Contributing
409
361
 
@@ -413,7 +365,7 @@ to make a release, as they'll need to run a release script from the
413
365
  4. Push to the branch (`git push origin my-new-feature`)
414
366
  5. Create a new Pull Request
415
367
 
416
- [apidocs]: https://asana.com/developers
417
- [io]: https://asana.com/developers/documentation/getting-started/input-output-options
368
+ [apidocs]: https://developers.asana.com/docs
369
+ [io]: https://developers.asana.com/docs/#input-output-options
418
370
  [docs]: http://www.rubydoc.info/github/Asana/ruby-asana/master
419
371
  [meta]: https://github.com/asana/asana-api-meta
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.10.3
data/asana.gemspec CHANGED
@@ -19,11 +19,11 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.required_ruby_version = '~> 2.0'
22
+ spec.required_ruby_version = '> 2.0'
23
23
 
24
24
  spec.add_dependency "oauth2", "~> 1.4"
25
- spec.add_dependency "faraday", "~> 0.9"
26
- spec.add_dependency "faraday_middleware", "~> 0.9"
25
+ spec.add_dependency "faraday", "~> 1.0"
26
+ spec.add_dependency "faraday_middleware", "~> 1.0"
27
27
  spec.add_dependency "faraday_middleware-multi_json", "~> 0.0"
28
28
 
29
29
  spec.add_development_dependency "rake", "~> 10.0"
@@ -1,33 +1,33 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- asana (0.9.0)
5
- faraday (~> 0.9)
6
- faraday_middleware (~> 0.9)
4
+ asana (0.10.3)
5
+ faraday (~> 1.0)
6
+ faraday_middleware (~> 1.0)
7
7
  faraday_middleware-multi_json (~> 0.0)
8
8
  oauth2 (~> 1.4)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- faraday (0.15.4)
13
+ faraday (1.0.1)
14
14
  multipart-post (>= 1.2, < 3)
15
- faraday_middleware (0.13.1)
16
- faraday (>= 0.7.4, < 1.0)
15
+ faraday_middleware (1.0.0)
16
+ faraday (~> 1.0)
17
17
  faraday_middleware-multi_json (0.0.6)
18
18
  faraday_middleware
19
19
  multi_json
20
20
  jwt (2.2.1)
21
- multi_json (1.13.1)
21
+ multi_json (1.15.0)
22
22
  multi_xml (0.6.0)
23
23
  multipart-post (2.1.1)
24
- oauth2 (1.4.1)
25
- faraday (>= 0.8, < 0.16.0)
24
+ oauth2 (1.4.4)
25
+ faraday (>= 0.8, < 2.0)
26
26
  jwt (>= 1.0, < 3.0)
27
27
  multi_json (~> 1.3)
28
28
  multi_xml (~> 0.5)
29
29
  rack (>= 1.2, < 3)
30
- rack (2.0.7)
30
+ rack (2.2.3)
31
31
 
32
32
  PLATFORMS
33
33
  ruby
data/lib/asana/client.rb CHANGED
@@ -59,8 +59,8 @@ module Asana
59
59
  @resource = resource
60
60
  end
61
61
 
62
- def method_missing(m, *args, &block)
63
- @resource.public_send(m, *([@client] + args), &block)
62
+ def method_missing(m, *args, **kwargs, &block)
63
+ @resource.public_send(m, *([@client] + args), **kwargs, &block)
64
64
  end
65
65
 
66
66
  def respond_to_missing?(m, *)
@@ -87,29 +87,29 @@ module Asana
87
87
  # Public: Performs a GET request against an arbitrary Asana URL. Allows for
88
88
  # the user to interact with the API in ways that haven't been
89
89
  # reflected/foreseen in this library.
90
- def get(url, *args)
91
- @http_client.get(url, *args)
90
+ def get(url, **args)
91
+ @http_client.get(url, **args)
92
92
  end
93
93
 
94
94
  # Public: Performs a POST request against an arbitrary Asana URL. Allows for
95
95
  # the user to interact with the API in ways that haven't been
96
96
  # reflected/foreseen in this library.
97
- def post(url, *args)
98
- @http_client.post(url, *args)
97
+ def post(url, **args)
98
+ @http_client.post(url, **args)
99
99
  end
100
100
 
101
101
  # Public: Performs a PUT request against an arbitrary Asana URL. Allows for
102
102
  # the user to interact with the API in ways that haven't been
103
103
  # reflected/foreseen in this library.
104
- def put(url, *args)
105
- @http_client.put(url, *args)
104
+ def put(url, **args)
105
+ @http_client.put(url, **args)
106
106
  end
107
107
 
108
108
  # Public: Performs a DELETE request against an arbitrary Asana URL. Allows
109
109
  # for the user to interact with the API in ways that haven't been
110
110
  # reflected/foreseen in this library.
111
- def delete(url, *args)
112
- @http_client.delete(url, *args)
111
+ def delete(url, **args)
112
+ @http_client.delete(url, **args)
113
113
  end
114
114
 
115
115
  # Public: Exposes queries for all top-evel endpoints.
@@ -108,11 +108,17 @@ module Asana
108
108
  #
109
109
  # resource_uri - [String] the resource URI relative to the base Asana API
110
110
  # URL, e.g "/tags".
111
+ # options - [Hash] the request I/O options
111
112
  #
112
113
  # Returns an [Asana::HttpClient::Response] if everything went well.
113
114
  # Raises [Asana::Errors::APIError] if anything went wrong.
114
- def delete(resource_uri)
115
- perform_request(:delete, resource_uri)
115
+ def delete(resource_uri, params: {}, options: {})
116
+ opts = options.reduce({}) do |acc, (k, v)|
117
+ acc.tap do |hash|
118
+ hash[:"opt_#{k}"] = v.is_a?(Array) ? v.join(',') : v
119
+ end
120
+ end
121
+ perform_request(:delete, resource_uri, params.merge(opts), options[:headers])
116
122
  end
117
123
 
118
124
  private
@@ -5,8 +5,9 @@ module Asana
5
5
  module AttachmentUploading
6
6
  # Uploads a new attachment to the resource.
7
7
  #
8
- # filename - [String] the absolute path of the file to upload.
8
+ # filename - [String] the absolute path of the file to upload OR the desired filename when using +io+
9
9
  # mime - [String] the MIME type of the file
10
+ # io - [IO] an object which returns the file's content on +#read+, e.g. a +::StringIO+
10
11
  # options - [Hash] the request I/O options
11
12
  # data - [Hash] extra attributes to post
12
13
  #
@@ -14,16 +15,22 @@ module Asana
14
15
  # rubocop:disable Metrics/MethodLength
15
16
  def attach(filename: required('filename'),
16
17
  mime: required('mime'),
17
- options: {}, **data)
18
- path = File.expand_path(filename)
19
- unless File.exist?(path)
20
- raise ArgumentError, "file #{filename} doesn't exist"
21
- end
22
- upload = Faraday::UploadIO.new(path, mime)
18
+ io: nil, options: {}, **data)
19
+
20
+ upload = if io.nil?
21
+ path = File.expand_path(filename)
22
+ raise ArgumentError, "file #{filename} doesn't exist" unless File.exist?(path)
23
+
24
+ Faraday::FilePart.new(path, mime)
25
+ else
26
+ Faraday::FilePart.new(io, mime, filename)
27
+ end
28
+
23
29
  response = client.post("/#{self.class.plural_name}/#{gid}/attachments",
24
30
  body: data,
25
31
  upload: upload,
26
32
  options: options)
33
+
27
34
  Attachment.new(parse(response).first, client: client)
28
35
  end
29
36
  # rubocop:enable Metrics/MethodLength
@@ -36,6 +36,11 @@ module Asana
36
36
  end
37
37
  end
38
38
 
39
+ # Public: Returns the last item in the collection.
40
+ def last
41
+ @elements.last
42
+ end
43
+
39
44
  # Public: Returns the size of the collection.
40
45
  def size
41
46
  to_a.size
@@ -9,10 +9,6 @@ module Asana
9
9
  include ResponseHelper
10
10
  extend ResponseHelper
11
11
 
12
- def self.inherited(base)
13
- Registry.register(base)
14
- end
15
-
16
12
  def initialize(data, client: required('client'))
17
13
  @_client = client
18
14
  @_data = data
@@ -1,16 +1,13 @@
1
- ### WARNING: This file is auto-generated by the asana-api-meta repo. Do not
2
- ### edit it manually.
1
+ require_relative 'gen/attachments_base'
3
2
 
4
3
  module Asana
5
4
  module Resources
6
5
  # An _attachment_ object represents any file attached to a task in Asana,
7
6
  # whether it's an uploaded file or one associated via a third-party service
8
7
  # such as Dropbox or Google Drive.
9
- class Attachment < Resource
8
+ class Attachment < AttachmentsBase
10
9
 
11
10
 
12
- attr_reader :id
13
-
14
11
  attr_reader :gid
15
12
 
16
13
  attr_reader :resource_type
@@ -0,0 +1,15 @@
1
+ require_relative 'gen/batch_api_base'
2
+
3
+ module Asana
4
+ module Resources
5
+ class BatchAPI < BatchAPIBase
6
+
7
+ class << self
8
+ # Returns the plural name of the resource.
9
+ def plural_name
10
+ 'batch_apis'
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,4 @@
1
- ### WARNING: This file is auto-generated by the asana-api-meta repo. Do not
2
- ### edit it manually.
1
+ require_relative 'gen/custom_field_settings_base'
3
2
 
4
3
  module Asana
5
4
  module Resources
@@ -9,11 +8,9 @@ module Asana
9
8
  # stores information that is relevant to that particular pairing; for instance,
10
9
  # the `is_important` property determines some possible application-specific
11
10
  # handling of that custom field and parent.
12
- class CustomFieldSetting < Resource
11
+ class CustomFieldSetting < CustomFieldSettingsBase
13
12
 
14
13
 
15
- attr_reader :id
16
-
17
14
  attr_reader :gid
18
15
 
19
16
  attr_reader :resource_type
@@ -1,5 +1,4 @@
1
- ### WARNING: This file is auto-generated by the asana-api-meta repo. Do not
2
- ### edit it manually.
1
+ require_relative 'gen/custom_fields_base'
3
2
 
4
3
  module Asana
5
4
  module Resources
@@ -13,11 +12,9 @@ module Asana
13
12
  # fields](/guide/help/premium/custom-fields#gl-lock-fields), which will make
14
13
  # them read-only when accessed by other users. Attempting to edit a locked
15
14
  # custom field will return HTTP error code `403 Forbidden`.
16
- class CustomField < Resource
15
+ class CustomField < CustomFieldsBase
17
16
 
18
17
 
19
- attr_reader :id
20
-
21
18
  attr_reader :gid
22
19
 
23
20
  attr_reader :resource_type
@@ -0,0 +1,28 @@
1
+ require_relative 'gen/events_base'
2
+
3
+ module Asana
4
+ module Resources
5
+ class EventResponse < EventsBase
6
+
7
+
8
+ attr_reader :user
9
+
10
+ attr_reader :resource
11
+
12
+ attr_reader :type
13
+
14
+ attr_reader :action
15
+
16
+ attr_reader :parent
17
+
18
+ attr_reader :created_at
19
+
20
+ class << self
21
+ # Returns the plural name of the resource.
22
+ def plural_name
23
+ 'event_responses'
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,56 @@
1
+ ### WARNING: This file is auto-generated by our OpenAPI spec. Do not
2
+ ### edit it manually.
3
+
4
+ require_relative '../../resource_includes/response_helper'
5
+
6
+ module Asana
7
+ module Resources
8
+ class AttachmentsBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Delete an attachment
16
+ #
17
+ # attachment_gid - [str] (required) Globally unique identifier for the attachment.
18
+ # options - [Hash] the request I/O options
19
+ # > 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.
20
+ # > 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.
21
+ def delete_attachment(client, attachment_gid: required("attachment_gid"), options: {})
22
+ path = "/attachments/{attachment_gid}"
23
+ path["{attachment_gid}"] = attachment_gid
24
+ parse(client.delete(path, options: options)).first
25
+ end
26
+
27
+ # Get an attachment
28
+ #
29
+ # attachment_gid - [str] (required) Globally unique identifier for the attachment.
30
+ # options - [Hash] the request I/O options
31
+ # > 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.
32
+ # > 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.
33
+ def get_attachment(client, attachment_gid: required("attachment_gid"), options: {})
34
+ path = "/attachments/{attachment_gid}"
35
+ path["{attachment_gid}"] = attachment_gid
36
+ Attachment.new(parse(client.get(path, options: options)).first, client: client)
37
+ end
38
+
39
+ # Get attachments for a task
40
+ #
41
+ # task_gid - [str] (required) The task to operate on.
42
+ # options - [Hash] the request I/O options
43
+ # > 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.'
44
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
45
+ # > 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.
46
+ # > 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.
47
+ def get_attachments_for_task(client, task_gid: required("task_gid"), options: {})
48
+ path = "/tasks/{task_gid}/attachments"
49
+ path["{task_gid}"] = task_gid
50
+ Collection.new(parse(client.get(path, options: options)), type: Attachment, client: client)
51
+ end
52
+
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,30 @@
1
+ ### WARNING: This file is auto-generated by our OpenAPI spec. Do not
2
+ ### edit it manually.
3
+
4
+ require_relative '../../resource_includes/response_helper'
5
+
6
+ module Asana
7
+ module Resources
8
+ class BatchAPIBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Submit parallel requests
16
+ #
17
+
18
+ # options - [Hash] the request I/O options
19
+ # > 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.
20
+ # > 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.
21
+ # data - [Hash] the attributes to POST
22
+ def create_batch_request(client, options: {}, **data)
23
+ path = "/batch"
24
+ Collection.new(parse(client.post(path, body: data, options: options)), type: Resource, client: client)
25
+ end
26
+
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,46 @@
1
+ ### WARNING: This file is auto-generated by our OpenAPI spec. Do not
2
+ ### edit it manually.
3
+
4
+ require_relative '../../resource_includes/response_helper'
5
+
6
+ module Asana
7
+ module Resources
8
+ class CustomFieldSettingsBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Get a portfolio's custom fields
16
+ #
17
+ # portfolio_gid - [str] (required) Globally unique identifier for the portfolio.
18
+ # options - [Hash] the request I/O options
19
+ # > 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.'
20
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
21
+ # > 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.
22
+ # > 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.
23
+ def get_custom_field_settings_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {})
24
+ path = "/portfolios/{portfolio_gid}/custom_field_settings"
25
+ path["{portfolio_gid}"] = portfolio_gid
26
+ Collection.new(parse(client.get(path, options: options)), type: CustomFieldSetting, client: client)
27
+ end
28
+
29
+ # Get a project's custom fields
30
+ #
31
+ # project_gid - [str] (required) Globally unique identifier for the project.
32
+ # options - [Hash] the request I/O options
33
+ # > 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.'
34
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
35
+ # > 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.
36
+ # > 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.
37
+ def get_custom_field_settings_for_project(client, project_gid: required("project_gid"), options: {})
38
+ path = "/projects/{project_gid}/custom_field_settings"
39
+ path["{project_gid}"] = project_gid
40
+ Collection.new(parse(client.get(path, options: options)), type: CustomFieldSetting, client: client)
41
+ end
42
+
43
+ end
44
+ end
45
+ end
46
+ end