appwrite 1.0.8 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +16 -0
  3. data/CHANGELOG.md +1 -0
  4. data/Gemfile +1 -0
  5. data/LICENSE +1 -1
  6. data/README.md +10 -6
  7. data/appwrite.gemspec +3 -3
  8. data/docs/examples/avatars/get-browser.md +15 -0
  9. data/docs/examples/avatars/get-credit-card.md +15 -0
  10. data/docs/examples/avatars/get-favicon.md +15 -0
  11. data/docs/examples/avatars/get-flag.md +15 -0
  12. data/docs/examples/avatars/get-image.md +15 -0
  13. data/docs/examples/avatars/get-initials.md +15 -0
  14. data/docs/examples/avatars/get-q-r.md +15 -0
  15. data/docs/examples/database/create-collection.md +15 -0
  16. data/docs/examples/database/create-document.md +15 -0
  17. data/docs/examples/database/delete-collection.md +15 -0
  18. data/docs/examples/database/delete-document.md +15 -0
  19. data/docs/examples/database/get-collection.md +15 -0
  20. data/docs/examples/database/get-document.md +15 -0
  21. data/docs/examples/database/list-collections.md +15 -0
  22. data/docs/examples/database/list-documents.md +15 -0
  23. data/docs/examples/database/update-collection.md +15 -0
  24. data/docs/examples/database/update-document.md +15 -0
  25. data/docs/examples/functions/create-execution.md +15 -0
  26. data/docs/examples/functions/create-tag.md +15 -0
  27. data/docs/examples/functions/create.md +15 -0
  28. data/docs/examples/functions/delete-tag.md +15 -0
  29. data/docs/examples/functions/delete.md +15 -0
  30. data/docs/examples/functions/get-execution.md +15 -0
  31. data/docs/examples/functions/get-tag.md +15 -0
  32. data/docs/examples/functions/get.md +15 -0
  33. data/docs/examples/functions/list-executions.md +15 -0
  34. data/docs/examples/functions/list-tags.md +15 -0
  35. data/docs/examples/functions/list.md +15 -0
  36. data/docs/examples/functions/update-tag.md +15 -0
  37. data/docs/examples/functions/update.md +15 -0
  38. data/docs/examples/health/get-anti-virus.md +15 -0
  39. data/docs/examples/health/get-cache.md +15 -0
  40. data/docs/examples/health/get-d-b.md +15 -0
  41. data/docs/examples/health/get-queue-certificates.md +15 -0
  42. data/docs/examples/health/get-queue-functions.md +15 -0
  43. data/docs/examples/health/get-queue-logs.md +15 -0
  44. data/docs/examples/health/get-queue-tasks.md +15 -0
  45. data/docs/examples/health/get-queue-usage.md +15 -0
  46. data/docs/examples/health/get-queue-webhooks.md +15 -0
  47. data/docs/examples/health/get-storage-local.md +15 -0
  48. data/docs/examples/health/get-time.md +15 -0
  49. data/docs/examples/health/get.md +15 -0
  50. data/docs/examples/locale/get-continents.md +15 -0
  51. data/docs/examples/locale/get-countries-e-u.md +15 -0
  52. data/docs/examples/locale/get-countries-phones.md +15 -0
  53. data/docs/examples/locale/get-countries.md +15 -0
  54. data/docs/examples/locale/get-currencies.md +15 -0
  55. data/docs/examples/locale/get-languages.md +15 -0
  56. data/docs/examples/locale/get.md +15 -0
  57. data/docs/examples/storage/create-file.md +15 -0
  58. data/docs/examples/storage/delete-file.md +15 -0
  59. data/docs/examples/storage/get-file-download.md +15 -0
  60. data/docs/examples/storage/get-file-preview.md +15 -0
  61. data/docs/examples/storage/get-file-view.md +15 -0
  62. data/docs/examples/storage/get-file.md +15 -0
  63. data/docs/examples/storage/list-files.md +15 -0
  64. data/docs/examples/storage/update-file.md +15 -0
  65. data/docs/examples/teams/create-membership.md +15 -0
  66. data/docs/examples/teams/create.md +15 -0
  67. data/docs/examples/teams/delete-membership.md +15 -0
  68. data/docs/examples/teams/delete.md +15 -0
  69. data/docs/examples/teams/get-memberships.md +15 -0
  70. data/docs/examples/teams/get.md +15 -0
  71. data/docs/examples/teams/list.md +15 -0
  72. data/docs/examples/teams/update.md +15 -0
  73. data/docs/examples/users/create.md +15 -0
  74. data/docs/examples/users/delete-session.md +15 -0
  75. data/docs/examples/users/delete-sessions.md +15 -0
  76. data/docs/examples/users/delete-user.md +15 -0
  77. data/docs/examples/users/get-logs.md +15 -0
  78. data/docs/examples/users/get-prefs.md +15 -0
  79. data/docs/examples/users/get-sessions.md +15 -0
  80. data/docs/examples/users/get.md +15 -0
  81. data/docs/examples/users/list.md +15 -0
  82. data/docs/examples/users/update-prefs.md +15 -0
  83. data/docs/examples/users/update-status.md +15 -0
  84. data/lib/appwrite.rb +4 -3
  85. data/lib/appwrite/client.rb +46 -13
  86. data/lib/appwrite/file.rb +23 -0
  87. data/lib/appwrite/services/avatars.rb +17 -1
  88. data/lib/appwrite/services/database.rb +27 -29
  89. data/lib/appwrite/services/functions.rb +194 -0
  90. data/lib/appwrite/services/health.rb +141 -0
  91. data/lib/appwrite/services/locale.rb +12 -1
  92. data/lib/appwrite/services/storage.rb +9 -10
  93. data/lib/appwrite/services/teams.rb +21 -48
  94. data/lib/appwrite/services/users.rb +32 -20
  95. metadata +86 -11
  96. data/lib/appwrite/services/account.rb +0 -114
  97. data/lib/appwrite/services/auth.rb +0 -131
  98. data/lib/appwrite/services/projects.rb +0 -410
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appwrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Appwrite Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-07 00:00:00.000000000 Z
11
+ date: 2021-02-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: team@appwrite.io
@@ -16,19 +16,97 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
+ - ".travis.yml"
20
+ - CHANGELOG.md
19
21
  - Gemfile
20
22
  - LICENSE
21
23
  - README.md
22
24
  - appwrite.gemspec
25
+ - docs/examples/avatars/get-browser.md
26
+ - docs/examples/avatars/get-credit-card.md
27
+ - docs/examples/avatars/get-favicon.md
28
+ - docs/examples/avatars/get-flag.md
29
+ - docs/examples/avatars/get-image.md
30
+ - docs/examples/avatars/get-initials.md
31
+ - docs/examples/avatars/get-q-r.md
32
+ - docs/examples/database/create-collection.md
33
+ - docs/examples/database/create-document.md
34
+ - docs/examples/database/delete-collection.md
35
+ - docs/examples/database/delete-document.md
36
+ - docs/examples/database/get-collection.md
37
+ - docs/examples/database/get-document.md
38
+ - docs/examples/database/list-collections.md
39
+ - docs/examples/database/list-documents.md
40
+ - docs/examples/database/update-collection.md
41
+ - docs/examples/database/update-document.md
42
+ - docs/examples/functions/create-execution.md
43
+ - docs/examples/functions/create-tag.md
44
+ - docs/examples/functions/create.md
45
+ - docs/examples/functions/delete-tag.md
46
+ - docs/examples/functions/delete.md
47
+ - docs/examples/functions/get-execution.md
48
+ - docs/examples/functions/get-tag.md
49
+ - docs/examples/functions/get.md
50
+ - docs/examples/functions/list-executions.md
51
+ - docs/examples/functions/list-tags.md
52
+ - docs/examples/functions/list.md
53
+ - docs/examples/functions/update-tag.md
54
+ - docs/examples/functions/update.md
55
+ - docs/examples/health/get-anti-virus.md
56
+ - docs/examples/health/get-cache.md
57
+ - docs/examples/health/get-d-b.md
58
+ - docs/examples/health/get-queue-certificates.md
59
+ - docs/examples/health/get-queue-functions.md
60
+ - docs/examples/health/get-queue-logs.md
61
+ - docs/examples/health/get-queue-tasks.md
62
+ - docs/examples/health/get-queue-usage.md
63
+ - docs/examples/health/get-queue-webhooks.md
64
+ - docs/examples/health/get-storage-local.md
65
+ - docs/examples/health/get-time.md
66
+ - docs/examples/health/get.md
67
+ - docs/examples/locale/get-continents.md
68
+ - docs/examples/locale/get-countries-e-u.md
69
+ - docs/examples/locale/get-countries-phones.md
70
+ - docs/examples/locale/get-countries.md
71
+ - docs/examples/locale/get-currencies.md
72
+ - docs/examples/locale/get-languages.md
73
+ - docs/examples/locale/get.md
74
+ - docs/examples/storage/create-file.md
75
+ - docs/examples/storage/delete-file.md
76
+ - docs/examples/storage/get-file-download.md
77
+ - docs/examples/storage/get-file-preview.md
78
+ - docs/examples/storage/get-file-view.md
79
+ - docs/examples/storage/get-file.md
80
+ - docs/examples/storage/list-files.md
81
+ - docs/examples/storage/update-file.md
82
+ - docs/examples/teams/create-membership.md
83
+ - docs/examples/teams/create.md
84
+ - docs/examples/teams/delete-membership.md
85
+ - docs/examples/teams/delete.md
86
+ - docs/examples/teams/get-memberships.md
87
+ - docs/examples/teams/get.md
88
+ - docs/examples/teams/list.md
89
+ - docs/examples/teams/update.md
90
+ - docs/examples/users/create.md
91
+ - docs/examples/users/delete-session.md
92
+ - docs/examples/users/delete-sessions.md
93
+ - docs/examples/users/delete-user.md
94
+ - docs/examples/users/get-logs.md
95
+ - docs/examples/users/get-prefs.md
96
+ - docs/examples/users/get-sessions.md
97
+ - docs/examples/users/get.md
98
+ - docs/examples/users/list.md
99
+ - docs/examples/users/update-prefs.md
100
+ - docs/examples/users/update-status.md
23
101
  - lib/appwrite.rb
24
102
  - lib/appwrite/client.rb
103
+ - lib/appwrite/file.rb
25
104
  - lib/appwrite/service.rb
26
- - lib/appwrite/services/account.rb
27
- - lib/appwrite/services/auth.rb
28
105
  - lib/appwrite/services/avatars.rb
29
106
  - lib/appwrite/services/database.rb
107
+ - lib/appwrite/services/functions.rb
108
+ - lib/appwrite/services/health.rb
30
109
  - lib/appwrite/services/locale.rb
31
- - lib/appwrite/services/projects.rb
32
110
  - lib/appwrite/services/storage.rb
33
111
  - lib/appwrite/services/teams.rb
34
112
  - lib/appwrite/services/users.rb
@@ -50,12 +128,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
128
  - !ruby/object:Gem::Version
51
129
  version: '0'
52
130
  requirements: []
53
- rubyforge_project:
54
- rubygems_version: 2.5.2.3
131
+ rubygems_version: 3.0.8
55
132
  signing_key:
56
133
  specification_version: 4
57
- summary: Appwrite backend as a service cuts up to 70% of the time and costs required
58
- for building a modern application. We abstract and simplify common development tasks
59
- behind a REST APIs, to help you develop your app in a fast and secure way. For full
60
- API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
134
+ summary: Appwrite is an open-source self-hosted backend server that abstract and simplify
135
+ complex and repetitive development tasks behind a very simple REST API
61
136
  test_files: []
@@ -1,114 +0,0 @@
1
- module Appwrite
2
- class Account < Service
3
-
4
- def get()
5
- path = '/account'
6
-
7
- params = {
8
- }
9
-
10
- return @client.call('get', path, {
11
- 'content-type' => 'application/json',
12
- }, params);
13
- end
14
-
15
- def delete()
16
- path = '/account'
17
-
18
- params = {
19
- }
20
-
21
- return @client.call('delete', path, {
22
- 'content-type' => 'application/json',
23
- }, params);
24
- end
25
-
26
- def update_email(email:, password:)
27
- path = '/account/email'
28
-
29
- params = {
30
- 'email': email,
31
- 'password': password
32
- }
33
-
34
- return @client.call('patch', path, {
35
- 'content-type' => 'application/json',
36
- }, params);
37
- end
38
-
39
- def update_name(name:)
40
- path = '/account/name'
41
-
42
- params = {
43
- 'name': name
44
- }
45
-
46
- return @client.call('patch', path, {
47
- 'content-type' => 'application/json',
48
- }, params);
49
- end
50
-
51
- def update_password(password:, old_password:)
52
- path = '/account/password'
53
-
54
- params = {
55
- 'password': password,
56
- 'old-password': old_password
57
- }
58
-
59
- return @client.call('patch', path, {
60
- 'content-type' => 'application/json',
61
- }, params);
62
- end
63
-
64
- def get_prefs()
65
- path = '/account/prefs'
66
-
67
- params = {
68
- }
69
-
70
- return @client.call('get', path, {
71
- 'content-type' => 'application/json',
72
- }, params);
73
- end
74
-
75
- def update_prefs(prefs:)
76
- path = '/account/prefs'
77
-
78
- params = {
79
- 'prefs': prefs
80
- }
81
-
82
- return @client.call('patch', path, {
83
- 'content-type' => 'application/json',
84
- }, params);
85
- end
86
-
87
- def get_security()
88
- path = '/account/security'
89
-
90
- params = {
91
- }
92
-
93
- return @client.call('get', path, {
94
- 'content-type' => 'application/json',
95
- }, params);
96
- end
97
-
98
- def get_sessions()
99
- path = '/account/sessions'
100
-
101
- params = {
102
- }
103
-
104
- return @client.call('get', path, {
105
- 'content-type' => 'application/json',
106
- }, params);
107
- end
108
-
109
-
110
- protected
111
-
112
- private
113
- end
114
- end
@@ -1,131 +0,0 @@
1
- module Appwrite
2
- class Auth < Service
3
-
4
- def login(email:, password:, success: '', failure: '')
5
- path = '/auth/login'
6
-
7
- params = {
8
- 'email': email,
9
- 'password': password,
10
- 'success': success,
11
- 'failure': failure
12
- }
13
-
14
- return @client.call('post', path, {
15
- 'content-type' => 'application/json',
16
- }, params);
17
- end
18
-
19
- def oauth(provider:, success:, failure:)
20
- path = '/auth/login/oauth/{provider}'
21
- .gsub('{provider}', provider)
22
-
23
- params = {
24
- 'success': success,
25
- 'failure': failure
26
- }
27
-
28
- return @client.call('get', path, {
29
- 'content-type' => 'application/json',
30
- }, params);
31
- end
32
-
33
- def logout()
34
- path = '/auth/logout'
35
-
36
- params = {
37
- }
38
-
39
- return @client.call('delete', path, {
40
- 'content-type' => 'application/json',
41
- }, params);
42
- end
43
-
44
- def logout_by_session(id:)
45
- path = '/auth/logout/{id}'
46
- .gsub('{id}', id)
47
-
48
- params = {
49
- }
50
-
51
- return @client.call('delete', path, {
52
- 'content-type' => 'application/json',
53
- }, params);
54
- end
55
-
56
- def recovery(email:, reset:)
57
- path = '/auth/recovery'
58
-
59
- params = {
60
- 'email': email,
61
- 'reset': reset
62
- }
63
-
64
- return @client.call('post', path, {
65
- 'content-type' => 'application/json',
66
- }, params);
67
- end
68
-
69
- def recovery_reset(user_id:, token:, password_a:, password_b:)
70
- path = '/auth/recovery/reset'
71
-
72
- params = {
73
- 'userId': user_id,
74
- 'token': token,
75
- 'password-a': password_a,
76
- 'password-b': password_b
77
- }
78
-
79
- return @client.call('put', path, {
80
- 'content-type' => 'application/json',
81
- }, params);
82
- end
83
-
84
- def register(email:, password:, confirm:, success: '', failure: '', name: '')
85
- path = '/auth/register'
86
-
87
- params = {
88
- 'email': email,
89
- 'password': password,
90
- 'confirm': confirm,
91
- 'success': success,
92
- 'failure': failure,
93
- 'name': name
94
- }
95
-
96
- return @client.call('post', path, {
97
- 'content-type' => 'application/json',
98
- }, params);
99
- end
100
-
101
- def confirm(user_id:, token:)
102
- path = '/auth/register/confirm'
103
-
104
- params = {
105
- 'userId': user_id,
106
- 'token': token
107
- }
108
-
109
- return @client.call('post', path, {
110
- 'content-type' => 'application/json',
111
- }, params);
112
- end
113
-
114
- def confirm_resend(confirm:)
115
- path = '/auth/register/confirm/resend'
116
-
117
- params = {
118
- 'confirm': confirm
119
- }
120
-
121
- return @client.call('post', path, {
122
- 'content-type' => 'application/json',
123
- }, params);
124
- end
125
-
126
-
127
- protected
128
-
129
- private
130
- end
131
- end
@@ -1,410 +0,0 @@
1
- module Appwrite
2
- class Projects < Service
3
-
4
- def list_projects()
5
- path = '/projects'
6
-
7
- params = {
8
- }
9
-
10
- return @client.call('get', path, {
11
- 'content-type' => 'application/json',
12
- }, params);
13
- end
14
-
15
- def create_project(name:, team_id:, description: '', logo: '', url: '', legal_name: '', legal_country: '', legal_state: '', legal_city: '', legal_address: '', legal_tax_id: '')
16
- path = '/projects'
17
-
18
- params = {
19
- 'name': name,
20
- 'teamId': team_id,
21
- 'description': description,
22
- 'logo': logo,
23
- 'url': url,
24
- 'legalName': legal_name,
25
- 'legalCountry': legal_country,
26
- 'legalState': legal_state,
27
- 'legalCity': legal_city,
28
- 'legalAddress': legal_address,
29
- 'legalTaxId': legal_tax_id
30
- }
31
-
32
- return @client.call('post', path, {
33
- 'content-type' => 'application/json',
34
- }, params);
35
- end
36
-
37
- def get_project(project_id:)
38
- path = '/projects/{projectId}'
39
- .gsub('{project_id}', project_id)
40
-
41
- params = {
42
- }
43
-
44
- return @client.call('get', path, {
45
- 'content-type' => 'application/json',
46
- }, params);
47
- end
48
-
49
- def update_project(project_id:, name:, description: '', logo: '', url: '', legal_name: '', legal_country: '', legal_state: '', legal_city: '', legal_address: '', legal_tax_id: '')
50
- path = '/projects/{projectId}'
51
- .gsub('{project_id}', project_id)
52
-
53
- params = {
54
- 'name': name,
55
- 'description': description,
56
- 'logo': logo,
57
- 'url': url,
58
- 'legalName': legal_name,
59
- 'legalCountry': legal_country,
60
- 'legalState': legal_state,
61
- 'legalCity': legal_city,
62
- 'legalAddress': legal_address,
63
- 'legalTaxId': legal_tax_id
64
- }
65
-
66
- return @client.call('patch', path, {
67
- 'content-type' => 'application/json',
68
- }, params);
69
- end
70
-
71
- def delete_project(project_id:)
72
- path = '/projects/{projectId}'
73
- .gsub('{project_id}', project_id)
74
-
75
- params = {
76
- }
77
-
78
- return @client.call('delete', path, {
79
- 'content-type' => 'application/json',
80
- }, params);
81
- end
82
-
83
- def list_keys(project_id:)
84
- path = '/projects/{projectId}/keys'
85
- .gsub('{project_id}', project_id)
86
-
87
- params = {
88
- }
89
-
90
- return @client.call('get', path, {
91
- 'content-type' => 'application/json',
92
- }, params);
93
- end
94
-
95
- def create_key(project_id:, name:, scopes:)
96
- path = '/projects/{projectId}/keys'
97
- .gsub('{project_id}', project_id)
98
-
99
- params = {
100
- 'name': name,
101
- 'scopes': scopes
102
- }
103
-
104
- return @client.call('post', path, {
105
- 'content-type' => 'application/json',
106
- }, params);
107
- end
108
-
109
- def get_key(project_id:, key_id:)
110
- path = '/projects/{projectId}/keys/{keyId}'
111
- .gsub('{project_id}', project_id)
112
- .gsub('{key_id}', key_id)
113
-
114
- params = {
115
- }
116
-
117
- return @client.call('get', path, {
118
- 'content-type' => 'application/json',
119
- }, params);
120
- end
121
-
122
- def update_key(project_id:, key_id:, name:, scopes:)
123
- path = '/projects/{projectId}/keys/{keyId}'
124
- .gsub('{project_id}', project_id)
125
- .gsub('{key_id}', key_id)
126
-
127
- params = {
128
- 'name': name,
129
- 'scopes': scopes
130
- }
131
-
132
- return @client.call('put', path, {
133
- 'content-type' => 'application/json',
134
- }, params);
135
- end
136
-
137
- def delete_key(project_id:, key_id:)
138
- path = '/projects/{projectId}/keys/{keyId}'
139
- .gsub('{project_id}', project_id)
140
- .gsub('{key_id}', key_id)
141
-
142
- params = {
143
- }
144
-
145
- return @client.call('delete', path, {
146
- 'content-type' => 'application/json',
147
- }, params);
148
- end
149
-
150
- def update_project_o_auth(project_id:, provider:, app_id: '', secret: '')
151
- path = '/projects/{projectId}/oauth'
152
- .gsub('{project_id}', project_id)
153
-
154
- params = {
155
- 'provider': provider,
156
- 'appId': app_id,
157
- 'secret': secret
158
- }
159
-
160
- return @client.call('patch', path, {
161
- 'content-type' => 'application/json',
162
- }, params);
163
- end
164
-
165
- def list_platforms(project_id:)
166
- path = '/projects/{projectId}/platforms'
167
- .gsub('{project_id}', project_id)
168
-
169
- params = {
170
- }
171
-
172
- return @client.call('get', path, {
173
- 'content-type' => 'application/json',
174
- }, params);
175
- end
176
-
177
- def create_platform(project_id:, type:, name:, key: '', store: '', url: '')
178
- path = '/projects/{projectId}/platforms'
179
- .gsub('{project_id}', project_id)
180
-
181
- params = {
182
- 'type': type,
183
- 'name': name,
184
- 'key': key,
185
- 'store': store,
186
- 'url': url
187
- }
188
-
189
- return @client.call('post', path, {
190
- 'content-type' => 'application/json',
191
- }, params);
192
- end
193
-
194
- def get_platform(project_id:, platform_id:)
195
- path = '/projects/{projectId}/platforms/{platformId}'
196
- .gsub('{project_id}', project_id)
197
- .gsub('{platform_id}', platform_id)
198
-
199
- params = {
200
- }
201
-
202
- return @client.call('get', path, {
203
- 'content-type' => 'application/json',
204
- }, params);
205
- end
206
-
207
- def update_platform(project_id:, platform_id:, name:, key: '', store: '', url: '')
208
- path = '/projects/{projectId}/platforms/{platformId}'
209
- .gsub('{project_id}', project_id)
210
- .gsub('{platform_id}', platform_id)
211
-
212
- params = {
213
- 'name': name,
214
- 'key': key,
215
- 'store': store,
216
- 'url': url
217
- }
218
-
219
- return @client.call('put', path, {
220
- 'content-type' => 'application/json',
221
- }, params);
222
- end
223
-
224
- def delete_platform(project_id:, platform_id:)
225
- path = '/projects/{projectId}/platforms/{platformId}'
226
- .gsub('{project_id}', project_id)
227
- .gsub('{platform_id}', platform_id)
228
-
229
- params = {
230
- }
231
-
232
- return @client.call('delete', path, {
233
- 'content-type' => 'application/json',
234
- }, params);
235
- end
236
-
237
- def list_tasks(project_id:)
238
- path = '/projects/{projectId}/tasks'
239
- .gsub('{project_id}', project_id)
240
-
241
- params = {
242
- }
243
-
244
- return @client.call('get', path, {
245
- 'content-type' => 'application/json',
246
- }, params);
247
- end
248
-
249
- def create_task(project_id:, name:, status:, schedule:, security:, http_method:, http_url:, http_headers: [], http_user: '', http_pass: '')
250
- path = '/projects/{projectId}/tasks'
251
- .gsub('{project_id}', project_id)
252
-
253
- params = {
254
- 'name': name,
255
- 'status': status,
256
- 'schedule': schedule,
257
- 'security': security,
258
- 'httpMethod': http_method,
259
- 'httpUrl': http_url,
260
- 'httpHeaders': http_headers,
261
- 'httpUser': http_user,
262
- 'httpPass': http_pass
263
- }
264
-
265
- return @client.call('post', path, {
266
- 'content-type' => 'application/json',
267
- }, params);
268
- end
269
-
270
- def get_task(project_id:, task_id:)
271
- path = '/projects/{projectId}/tasks/{taskId}'
272
- .gsub('{project_id}', project_id)
273
- .gsub('{task_id}', task_id)
274
-
275
- params = {
276
- }
277
-
278
- return @client.call('get', path, {
279
- 'content-type' => 'application/json',
280
- }, params);
281
- end
282
-
283
- def update_task(project_id:, task_id:, name:, status:, schedule:, security:, http_method:, http_url:, http_headers: [], http_user: '', http_pass: '')
284
- path = '/projects/{projectId}/tasks/{taskId}'
285
- .gsub('{project_id}', project_id)
286
- .gsub('{task_id}', task_id)
287
-
288
- params = {
289
- 'name': name,
290
- 'status': status,
291
- 'schedule': schedule,
292
- 'security': security,
293
- 'httpMethod': http_method,
294
- 'httpUrl': http_url,
295
- 'httpHeaders': http_headers,
296
- 'httpUser': http_user,
297
- 'httpPass': http_pass
298
- }
299
-
300
- return @client.call('put', path, {
301
- 'content-type' => 'application/json',
302
- }, params);
303
- end
304
-
305
- def delete_task(project_id:, task_id:)
306
- path = '/projects/{projectId}/tasks/{taskId}'
307
- .gsub('{project_id}', project_id)
308
- .gsub('{task_id}', task_id)
309
-
310
- params = {
311
- }
312
-
313
- return @client.call('delete', path, {
314
- 'content-type' => 'application/json',
315
- }, params);
316
- end
317
-
318
- def get_project_usage(project_id:)
319
- path = '/projects/{projectId}/usage'
320
- .gsub('{project_id}', project_id)
321
-
322
- params = {
323
- }
324
-
325
- return @client.call('get', path, {
326
- 'content-type' => 'application/json',
327
- }, params);
328
- end
329
-
330
- def list_webhooks(project_id:)
331
- path = '/projects/{projectId}/webhooks'
332
- .gsub('{project_id}', project_id)
333
-
334
- params = {
335
- }
336
-
337
- return @client.call('get', path, {
338
- 'content-type' => 'application/json',
339
- }, params);
340
- end
341
-
342
- def create_webhook(project_id:, name:, events:, url:, security:, http_user: '', http_pass: '')
343
- path = '/projects/{projectId}/webhooks'
344
- .gsub('{project_id}', project_id)
345
-
346
- params = {
347
- 'name': name,
348
- 'events': events,
349
- 'url': url,
350
- 'security': security,
351
- 'httpUser': http_user,
352
- 'httpPass': http_pass
353
- }
354
-
355
- return @client.call('post', path, {
356
- 'content-type' => 'application/json',
357
- }, params);
358
- end
359
-
360
- def get_webhook(project_id:, webhook_id:)
361
- path = '/projects/{projectId}/webhooks/{webhookId}'
362
- .gsub('{project_id}', project_id)
363
- .gsub('{webhook_id}', webhook_id)
364
-
365
- params = {
366
- }
367
-
368
- return @client.call('get', path, {
369
- 'content-type' => 'application/json',
370
- }, params);
371
- end
372
-
373
- def update_webhook(project_id:, webhook_id:, name:, events:, url:, security:, http_user: '', http_pass: '')
374
- path = '/projects/{projectId}/webhooks/{webhookId}'
375
- .gsub('{project_id}', project_id)
376
- .gsub('{webhook_id}', webhook_id)
377
-
378
- params = {
379
- 'name': name,
380
- 'events': events,
381
- 'url': url,
382
- 'security': security,
383
- 'httpUser': http_user,
384
- 'httpPass': http_pass
385
- }
386
-
387
- return @client.call('put', path, {
388
- 'content-type' => 'application/json',
389
- }, params);
390
- end
391
-
392
- def delete_webhook(project_id:, webhook_id:)
393
- path = '/projects/{projectId}/webhooks/{webhookId}'
394
- .gsub('{project_id}', project_id)
395
- .gsub('{webhook_id}', webhook_id)
396
-
397
- params = {
398
- }
399
-
400
- return @client.call('delete', path, {
401
- 'content-type' => 'application/json',
402
- }, params);
403
- end
404
-
405
-
406
- protected
407
-
408
- private
409
- end
410
- end