click_up 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63c4a01c0a82ecb2d67e78014791cc49201e986767178eba67b6674bc0dfb739
4
- data.tar.gz: e9df7b7a8a6a0fe422477dd6819672dc876b30a0bc9069ced27fec3bace67889
3
+ metadata.gz: c019b479637fd2046363ab70c1c257534412cb331bc1e6b4b110aba1329e8d5f
4
+ data.tar.gz: 8d42b415d00cc9768114bece96e8f91442b9db05fe1945b6d452e36b9af99f72
5
5
  SHA512:
6
- metadata.gz: 374be8c97b3094db1eade7fb5030b7a2215657fd6d9cd266220a0b847f3b213d8aa449153fcbe3cb86a832b849f0c2f09d977adbefe5c6b7fec1d13734451e22
7
- data.tar.gz: 81cd9b8691a072cdafa0c67ba02d8d98441a0a0ffe74843c2cafba126534a29e10092c14ebe471ff195adc585018325c58a75dea7106e6aff9c50bc4aed91a2b
6
+ metadata.gz: 774a45e861cf393c9c25d542b46bef131798edfc86bdc02ae1b1d3844b06efc1f41ad7330bc01d6cb2052327b1f06d82699d5d56ba71eb067b4e01ca003d11da
7
+ data.tar.gz: 6c61c68f35b3a15bb5f3a9bbcf67565ba3008e1ec3c190f91b61a44e94d090c9878f7dcded9398b77e209d9f78ab5f149b1b9b68a42825f6c283aa1c759a80ae
data/README.md CHANGED
@@ -1,2 +1,69 @@
1
- # clickup
2
- ClickUp API library for rails
1
+ # ClickUp API Ruby Library
2
+ ClickUp API solution for Ruby. As of now, it doesn't support OAuth Authentication. You can only use personal token based authentication.
3
+
4
+ # Getting Started
5
+
6
+ ```ruby
7
+ gem install 'click_up'
8
+ ```
9
+ Or add the following line to your Gemfile.
10
+
11
+ ```ruby
12
+ gem 'click_up'
13
+ ```
14
+ Next, you need to run the generator:
15
+
16
+ ```ruby
17
+ rails generate click_up:install
18
+ ```
19
+ It generates a `click_up.rb` initializer file at `config/initializers/`.
20
+
21
+ Add your ClickUp personal token to this initializer file:
22
+
23
+ ```ruby
24
+ ClickUp.api_token = 'pk_1e2....................'
25
+ ```
26
+
27
+ # Usage
28
+
29
+ ## Team
30
+ ```ruby
31
+ ClickUp::Team.all
32
+ ```
33
+
34
+ ## Space
35
+ ```ruby
36
+ ClickUp::Space.all(team_id: 3451451)
37
+
38
+ ClickUp::Space.create(team_id: 3451451, name: 'Space From API')
39
+
40
+ ClickUp::Space.get(323455)
41
+ ```
42
+
43
+ ## Folder
44
+ ```ruby
45
+ ClickUp::Folder.create(space_id: 323455, name: 'Folder From API')
46
+
47
+ ClickUp::Folder.get(756376)
48
+ ```
49
+
50
+ ## List
51
+ ```ruby
52
+ ClickUp::List.create(space_id: 323455, name: 'Folderless list')
53
+
54
+ ClickUp::List.create(folder_id: 756376, name: 'Foldered list')
55
+ ```
56
+
57
+ ## Task
58
+
59
+ ```ruby
60
+ ClickUp::Task.all(list_id: 4766363)
61
+
62
+ ClickUp::Task.create(list_id: 4766363, name: 'Task from API')
63
+ ```
64
+
65
+ # Additional Information
66
+ Pull requests and comments are welcome.
67
+
68
+ ## License
69
+ MIT License
@@ -11,6 +11,7 @@ require 'click_up/api_resource'
11
11
  require 'click_up/api_operations/create'
12
12
  require 'click_up/api_operations/get'
13
13
  require 'click_up/api_operations/all'
14
+ require 'click_up/api_operations/delete'
14
15
 
15
16
  require 'click_up/hierarchy/team'
16
17
  require 'click_up/hierarchy/space'
@@ -0,0 +1,14 @@
1
+ module ClickUp
2
+ module APIOperations
3
+ module Delete
4
+ def delete(id=nil, **opts)
5
+ params = opts.clone
6
+ unless params.has_key?(:id) || id
7
+ raise ParamRequiredError, "id is a required parameter.", "id"
8
+ end
9
+ params[:id] = id ? id : params[:id]
10
+ execute_request(:delete, resource_path(params))
11
+ end
12
+ end
13
+ end
14
+ end
@@ -20,6 +20,11 @@ module ClickUp
20
20
  format_response(net_http_response.body)
21
21
  end
22
22
 
23
+ def delete
24
+ net_http_response = https_client.delete(resource_url.path, default_headers)
25
+ format_response(net_http_response.body)
26
+ end
27
+
23
28
  private
24
29
  def resource_url
25
30
  uri = URI("#{api_base}#{namespace}#{path}")
@@ -5,6 +5,7 @@ module ClickUp
5
5
  extend ClickUp::APIOperations::All
6
6
  extend ClickUp::APIOperations::Create
7
7
  extend ClickUp::APIOperations::Get
8
+ extend ClickUp::APIOperations::Delete
8
9
 
9
10
  class << self
10
11
  def index_path(params={})
@@ -5,6 +5,7 @@ module ClickUp
5
5
  extend ClickUp::APIOperations::All
6
6
  extend ClickUp::APIOperations::Create
7
7
  extend ClickUp::APIOperations::Get
8
+ extend ClickUp::APIOperations::Delete
8
9
 
9
10
  class << self
10
11
  def index_path(params={})
@@ -5,6 +5,7 @@ module ClickUp
5
5
  extend ClickUp::APIOperations::All
6
6
  extend ClickUp::APIOperations::Create
7
7
  extend ClickUp::APIOperations::Get
8
+ extend ClickUp::APIOperations::Delete
8
9
 
9
10
  class << self
10
11
  def index_path(params={})
@@ -5,6 +5,7 @@ module ClickUp
5
5
  extend ClickUp::APIOperations::All
6
6
  extend ClickUp::APIOperations::Create
7
7
  extend ClickUp::APIOperations::Get
8
+ extend ClickUp::APIOperations::Delete
8
9
 
9
10
  class << self
10
11
  def index_path(params={})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClickUp
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: click_up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ayer-dines
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-15 00:00:00.000000000 Z
11
+ date: 2021-01-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'ClickUp: One app to replace them all.'
14
14
  email: budhayer96d@gmail.com
@@ -23,6 +23,7 @@ files:
23
23
  - lib/click_up.rb
24
24
  - lib/click_up/api_operations/all.rb
25
25
  - lib/click_up/api_operations/create.rb
26
+ - lib/click_up/api_operations/delete.rb
26
27
  - lib/click_up/api_operations/get.rb
27
28
  - lib/click_up/api_resource.rb
28
29
  - lib/click_up/connection_manager.rb