kinetic_sdk 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +5 -5
  2. data/.yardoc-includes/yard-helpers.rb +14 -0
  3. data/.yardopts +7 -0
  4. data/CHANGELOG.md +41 -0
  5. data/GettingStarted.md +6 -12
  6. data/README.md +85 -37
  7. data/Rakefile +13 -0
  8. data/kinetic_sdk.gemspec +33 -0
  9. data/lib/kinetic_sdk/agent/agent-sdk.rb +90 -0
  10. data/lib/kinetic_sdk/agent/lib/bridges.rb +92 -0
  11. data/lib/kinetic_sdk/agent/lib/filestores.rb +91 -0
  12. data/lib/kinetic_sdk/agent/lib/handler.rb +91 -0
  13. data/lib/kinetic_sdk/bridgehub/bridgehub-sdk.rb +11 -3
  14. data/lib/kinetic_sdk/bridgehub/lib/access_keys.rb +5 -5
  15. data/lib/kinetic_sdk/bridgehub/lib/bridge.rb +5 -5
  16. data/lib/kinetic_sdk/{request_ce/request-ce-sdk.rb → core/core-sdk.rb} +30 -16
  17. data/lib/kinetic_sdk/core/lib/attribute_definitions.rb +500 -0
  18. data/lib/kinetic_sdk/core/lib/bridges.rb +141 -0
  19. data/lib/kinetic_sdk/{request_ce → core}/lib/categories.rb +3 -3
  20. data/lib/kinetic_sdk/{request_ce → core}/lib/datastore_form.rb +8 -8
  21. data/lib/kinetic_sdk/{request_ce → core}/lib/datastore_submissions.rb +20 -9
  22. data/lib/kinetic_sdk/{request_ce → core}/lib/form.rb +7 -7
  23. data/lib/kinetic_sdk/{request_ce → core}/lib/form_types.rb +4 -4
  24. data/lib/kinetic_sdk/{request_ce → core}/lib/jwt.rb +4 -4
  25. data/lib/kinetic_sdk/{request_ce → core}/lib/kapp.rb +7 -7
  26. data/lib/kinetic_sdk/{request_ce → core}/lib/meta.rb +3 -3
  27. data/lib/kinetic_sdk/{request_ce → core}/lib/oauth.rb +4 -4
  28. data/lib/kinetic_sdk/{request_ce → core}/lib/security_policy_definitions.rb +11 -11
  29. data/lib/kinetic_sdk/core/lib/space.rb +156 -0
  30. data/lib/kinetic_sdk/{request_ce → core}/lib/submissions.rb +11 -11
  31. data/lib/kinetic_sdk/{request_ce → core}/lib/system_api.rb +19 -7
  32. data/lib/kinetic_sdk/{request_ce → core}/lib/teams.rb +9 -9
  33. data/lib/kinetic_sdk/{request_ce → core}/lib/users.rb +15 -15
  34. data/lib/kinetic_sdk/{request_ce → core}/lib/webhook_jobs.rb +5 -5
  35. data/lib/kinetic_sdk/{request_ce → core}/lib/webhooks.rb +9 -9
  36. data/lib/kinetic_sdk/discussions/discussions-sdk.rb +12 -4
  37. data/lib/kinetic_sdk/discussions/lib/discussions.rb +8 -8
  38. data/lib/kinetic_sdk/discussions/lib/invitations.rb +9 -9
  39. data/lib/kinetic_sdk/discussions/lib/messages.rb +8 -8
  40. data/lib/kinetic_sdk/discussions/lib/meta.rb +1 -1
  41. data/lib/kinetic_sdk/discussions/lib/participants.rb +5 -5
  42. data/lib/kinetic_sdk/discussions/lib/related_items.rb +4 -4
  43. data/lib/kinetic_sdk/discussions/lib/websockets.rb +9 -9
  44. data/lib/kinetic_sdk/filehub/filehub-sdk.rb +11 -3
  45. data/lib/kinetic_sdk/filehub/lib/access_keys.rb +5 -5
  46. data/lib/kinetic_sdk/filehub/lib/filestores.rb +5 -5
  47. data/lib/kinetic_sdk/task/lib/access_keys.rb +35 -7
  48. data/lib/kinetic_sdk/task/lib/categories.rb +30 -17
  49. data/lib/kinetic_sdk/task/lib/config.rb +14 -14
  50. data/lib/kinetic_sdk/task/lib/engine.rb +1 -1
  51. data/lib/kinetic_sdk/task/lib/errors.rb +10 -10
  52. data/lib/kinetic_sdk/task/lib/export.rb +32 -0
  53. data/lib/kinetic_sdk/task/lib/groups.rb +23 -10
  54. data/lib/kinetic_sdk/task/lib/handlers.rb +27 -11
  55. data/lib/kinetic_sdk/task/lib/health.rb +11 -3
  56. data/lib/kinetic_sdk/task/lib/license.rb +4 -4
  57. data/lib/kinetic_sdk/task/lib/policy_rules.rb +25 -12
  58. data/lib/kinetic_sdk/task/lib/runs.rb +43 -0
  59. data/lib/kinetic_sdk/task/lib/setup.rb +2 -2
  60. data/lib/kinetic_sdk/task/lib/sources.rb +39 -8
  61. data/lib/kinetic_sdk/task/lib/tasks.rb +1 -1
  62. data/lib/kinetic_sdk/task/lib/trees.rb +84 -28
  63. data/lib/kinetic_sdk/task/lib/users.rb +6 -6
  64. data/lib/kinetic_sdk/task/task-sdk.rb +16 -4
  65. data/lib/kinetic_sdk/utils/kinetic-export-utils.rb +157 -0
  66. data/lib/kinetic_sdk/utils/kinetic-http.rb +388 -98
  67. data/lib/kinetic_sdk/utils/logger.rb +82 -46
  68. data/lib/kinetic_sdk/utils/prettier-xml-formatter.rb +60 -0
  69. data/lib/kinetic_sdk/version.rb +1 -1
  70. data/lib/kinetic_sdk.rb +5 -2
  71. metadata +41 -27
  72. data/lib/kinetic_sdk/request_ce/lib/attribute_definitions.rb +0 -153
  73. data/lib/kinetic_sdk/request_ce/lib/bridges.rb +0 -66
  74. data/lib/kinetic_sdk/request_ce/lib/space.rb +0 -89
@@ -0,0 +1,500 @@
1
+ module KineticSdk
2
+ class Core
3
+
4
+ # Add a new datastore form attribute definition.
5
+ #
6
+ # @param name [String] name of the attribute definition
7
+ # @param description [String] description of the attribute definition
8
+ # @param allows_multiple [Boolean] whether the attribute allows multiple values
9
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
10
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
11
+ def add_datastore_form_attribute_definition(name, description, allows_multiple, headers=default_headers)
12
+ body = {
13
+ "allowsMultiple" => allows_multiple,
14
+ "description" => description,
15
+ "name" => name
16
+ }
17
+ @logger.info("Adding Datastore Form attribute definition \"#{name}\" to the \"#{space_slug}\" space.")
18
+ # Create the attribute definition
19
+ post("#{@api_url}/datastoreFormAttributeDefinitions", body, headers)
20
+ end
21
+
22
+ # Delete a datastore form attribute definition
23
+ #
24
+ # @param name [String] name of the attribute definition
25
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
26
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
27
+ def delete_datastore_form_attribute_definition(name, headers=default_headers)
28
+ @logger.info("Deleting the \"#{name}\" Datastore Form Attribute Definition")
29
+ delete("#{@api_url}/datastoreFormAttributeDefinitions/#{encode(name)}", headers)
30
+ end
31
+
32
+ # Find a datastore form attribute definition
33
+ #
34
+ # @param name [String] name of the attribute definition
35
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
36
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
37
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
38
+ def find_datastore_form_attribute_definition(name, params={}, headers=default_headers)
39
+ @logger.info("Finding the \"#{name}\" Datastore Form Attribute Definition")
40
+ get("#{@api_url}/datastoreFormAttributeDefinitions/#{encode(name)}", params, headers)
41
+ end
42
+
43
+ # Find all datastore form attribute definitions
44
+ #
45
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
46
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
47
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
48
+ def find_datastore_form_attribute_definitions(params={}, headers=default_headers)
49
+ @logger.info("Finding Datastore Form Attribute Definitions")
50
+ get("#{@api_url}/datastoreFormAttributeDefinitions", params, headers)
51
+ end
52
+
53
+ # Update a datastore form attribute definition
54
+ #
55
+ # @param name [String] name of the attribute definition
56
+ # @param body [Hash] properties of the attribute definition to update
57
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
58
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
59
+ def update_datastore_form_attribute_definition(name, body={}, headers=default_headers)
60
+ @logger.info("Updating the \"#{name}\" Datastore Form Attribute Definition.")
61
+ put("#{@api_url}/datastoreFormAttributeDefinitions/#{encode(name)}",body, headers)
62
+ end
63
+
64
+ # Add a new space attribute definition.
65
+ #
66
+ # @param name [String] name of the attribute definition
67
+ # @param description [String] description of the attribute definition
68
+ # @param allows_multiple [Boolean] whether the attribute allows multiple values
69
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
70
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
71
+ def add_space_attribute_definition(name, description, allows_multiple, headers=default_headers)
72
+ body = {
73
+ "allowsMultiple" => allows_multiple,
74
+ "description" => description,
75
+ "name" => name
76
+ }
77
+ @logger.info("Adding Space attribute definition \"#{name}\" to the \"#{space_slug}\" space.")
78
+ # Create the attribute definition
79
+ post("#{@api_url}/spaceAttributeDefinitions", body, headers)
80
+ end
81
+
82
+ # Delete a space attribute definition
83
+ #
84
+ # @param name [String] name of the attribute definition
85
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
86
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
87
+ def delete_space_attribute_definition(name, headers=default_headers)
88
+ @logger.info("Deleting the \"#{name}\" Space Attribute Definition")
89
+ delete("#{@api_url}/spaceAttributeDefinitions/#{encode(name)}", headers)
90
+ end
91
+
92
+ # Find a space attribute definition
93
+ #
94
+ # @param name [String] name of the attribute definition
95
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
96
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
97
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
98
+ def find_space_attribute_definition(name, params={}, headers=default_headers)
99
+ @logger.info("Finding the \"#{name}\" Space Attribute Definition")
100
+ get("#{@api_url}/spaceAttributeDefinitions/#{encode(name)}", params, headers)
101
+ end
102
+
103
+ # Find all space attribute definitions
104
+ #
105
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
106
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
107
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
108
+ def find_space_attribute_definitions(params={}, headers=default_headers)
109
+ @logger.info("Finding Space Attribute Definitions")
110
+ get("#{@api_url}/spaceAttributeDefinitions", params, headers)
111
+ end
112
+
113
+ # Update a space attribute definition
114
+ #
115
+ # @param name [String] name of the attribute definition
116
+ # @param body [Hash] properties of the attribute definition to update
117
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
118
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
119
+ def update_space_attribute_definition(name, body, headers=default_headers)
120
+ @logger.info("Updating the \"#{name}\" Space Attribute Definition.")
121
+ put("#{@api_url}/spaceAttributeDefinitions/#{encode(name)}",body, headers)
122
+ end
123
+
124
+ # Add a new team attribute definition.
125
+ #
126
+ # @param name [String] name of the attribute definition
127
+ # @param description [String] description of the attribute definition
128
+ # @param allows_multiple [Boolean] whether the attribute allows multiple values
129
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
130
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
131
+ def add_team_attribute_definition(name, description, allows_multiple, headers=default_headers)
132
+ body = {
133
+ "allowsMultiple" => allows_multiple,
134
+ "description" => description,
135
+ "name" => name
136
+ }
137
+ @logger.info("Adding Team attribute definition \"#{name}\" to the \"#{space_slug}\" space.")
138
+ # Create the team attribute definition
139
+ post("#{@api_url}/teamAttributeDefinitions", body, headers)
140
+ end
141
+
142
+ # Delete a team attribute definition
143
+ #
144
+ # @param name [String] name of the attribute definition
145
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
146
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
147
+ def delete_team_attribute_definition(name, headers=default_headers)
148
+ @logger.info("Deleting the \"#{name}\" Team Attribute Definition")
149
+ delete("#{@api_url}/teamAttributeDefinitions/#{encode(name)}", headers)
150
+ end
151
+
152
+ # Find a team attribute definition
153
+ #
154
+ # @param name [String] name of the attribute definition
155
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
156
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
157
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
158
+ def find_team_attribute_definition(name, params={}, headers=default_headers)
159
+ @logger.info("Finding the \"#{name}\" Team Attribute Definition")
160
+ get("#{@api_url}/teamAttributeDefinitions/#{encode(name)}", params, headers)
161
+ end
162
+
163
+ # Find all team attribute definitions
164
+ #
165
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
166
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
167
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
168
+ def find_team_attribute_definitions(params={}, headers=default_headers)
169
+ @logger.info("Finding Team Attribute Definitions")
170
+ get("#{@api_url}/teamAttributeDefinitions", params, headers)
171
+ end
172
+
173
+ # Update a team attribute definition
174
+ #
175
+ # @param name [String] name of the attribute definition
176
+ # @param body [Hash] properties of the attribute definition to update
177
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
178
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
179
+ def update_team_attribute_definition(name, body, headers=default_headers)
180
+ @logger.info("Updating the \"#{name}\" Team Attribute Definition.")
181
+ put("#{@api_url}/teamAttributeDefinitions/#{encode(name)}",body, headers)
182
+ end
183
+
184
+ # Add a new user attribute definition.
185
+ #
186
+ # @param name [String] name of the attribute definition
187
+ # @param description [String] description of the attribute definition
188
+ # @param allows_multiple [Boolean] whether the attribute allows multiple values
189
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
190
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
191
+ def add_user_attribute_definition(name, description, allows_multiple, headers=default_headers)
192
+ body = {
193
+ "allowsMultiple" => allows_multiple,
194
+ "description" => description,
195
+ "name" => name
196
+ }
197
+ @logger.info("Adding User attribute definition \"#{name}\" to the \"#{space_slug}\" space.")
198
+ # Create the user attribute definition
199
+ post("#{@api_url}/userAttributeDefinitions", body, headers)
200
+ end
201
+
202
+ # Delete a user attribute definition
203
+ #
204
+ # @param name [String] name of the attribute definition
205
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
206
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
207
+ def delete_user_attribute_definition(name, headers=default_headers)
208
+ @logger.info("Deleting the \"#{name}\" User Attribute Definition")
209
+ delete("#{@api_url}/userAttributeDefinitions/#{encode(name)}", headers)
210
+ end
211
+
212
+ # Find a user attribute definition
213
+ #
214
+ # @param name [String] name of the attribute definition
215
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
216
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
217
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
218
+ def find_user_attribute_definition(name, params={}, headers=default_headers)
219
+ @logger.info("Finding the \"#{name}\" User Attribute Definition")
220
+ get("#{@api_url}/userAttributeDefinitions/#{encode(name)}", params, headers)
221
+ end
222
+
223
+ # Find all user attribute definitions
224
+ #
225
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
226
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
227
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
228
+ def find_user_attribute_definitions(params={}, headers=default_headers)
229
+ @logger.info("Finding User Attribute Definitions")
230
+ get("#{@api_url}/userAttributeDefinitions", params, headers)
231
+ end
232
+
233
+ # Update a user attribute definition
234
+ #
235
+ # @param name [String] name of the attribute definition
236
+ # @param body [Hash] properties of the attribute definition to update
237
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
238
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
239
+ def update_user_attribute_definition(name, body, headers=default_headers)
240
+ @logger.info("Updating the \"#{name}\" User Attribute Definition.")
241
+ put("#{@api_url}/userAttributeDefinitions/#{encode(name)}",body, headers)
242
+ end
243
+
244
+ # Add a new user profile attribute definition.
245
+ #
246
+ # @param name [String] name of the attribute definition
247
+ # @param description [String] description of the attribute definition
248
+ # @param allows_multiple [Boolean] whether the attribute allows multiple values
249
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
250
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
251
+ def add_user_profile_attribute_definition(name, description, allows_multiple, headers=default_headers)
252
+ body = {
253
+ "allowsMultiple" => allows_multiple,
254
+ "description" => description,
255
+ "name" => name
256
+ }
257
+ @logger.info("Adding User attribute definition \"#{name}\" to the \"#{space_slug}\" space.")
258
+ # Create the user attribute definition
259
+ post("#{@api_url}/userProfileAttributeDefinitions", body, headers)
260
+ end
261
+
262
+ # Delete a user profile attribute definition
263
+ #
264
+ # @param name [String] name of the attribute definition
265
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
266
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
267
+ def delete_user_profile_attribute_definition(name, headers=default_headers)
268
+ @logger.info("Deleting the \"#{name}\" User Profile Attribute Definition")
269
+ delete("#{@api_url}/userProfileAttributeDefinitions/#{encode(name)}", headers)
270
+ end
271
+
272
+ # Find a user profile attribute definition
273
+ #
274
+ # @param name [String] name of the attribute definition
275
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
276
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
277
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
278
+ def find_user_profile_attribute_definition(name, params={}, headers=default_headers)
279
+ @logger.info("Finding the \"#{name}\" User Profile Attribute Definition")
280
+ get("#{@api_url}/userProfileAttributeDefinitions/#{encode(name)}", params, headers)
281
+ end
282
+
283
+ # Find user profile attribute definitions
284
+ #
285
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
286
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
287
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
288
+ def find_user_profile_attribute_definitions(params={}, headers=default_headers)
289
+ @logger.info("Finding User Profile Attribute Definitions")
290
+ get("#{@api_url}/userProfileAttributeDefinitions", params, headers)
291
+ end
292
+
293
+ # Update a user profile attribute definition
294
+ #
295
+ # @param name [String] name of the attribute definition
296
+ # @param body [Hash] properties of the attribute definition to update
297
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
298
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
299
+ def update_user_profile_attribute_definition(name, body, headers=default_headers)
300
+ @logger.info("Updating the \"#{name}\" User Profile Attribute Definition.")
301
+ put("#{@api_url}/userProfileAttributeDefinitions/#{encode(name)}",body, headers)
302
+ end
303
+
304
+ # Add a new category attribute definition.
305
+ #
306
+ # @param kapp_slug [String] slug of the kapp where the category exists
307
+ # @param name [String] name of the attribute definition
308
+ # @param description [String] description of the attribute definition
309
+ # @param allows_multiple [Boolean] whether the attribute allows multiple values
310
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
311
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
312
+ def add_category_attribute_definition(kapp_slug, name, description, allows_multiple, headers=default_headers)
313
+ body = {
314
+ "allowsMultiple" => allows_multiple,
315
+ "description" => description,
316
+ "name" => name
317
+ }
318
+ @logger.info("Adding Category attribute definition \"#{name}\" to the \"#{kapp_slug}\" kapp.")
319
+ # Create the attribute definition
320
+ post("#{@api_url}/kapps/#{kapp_slug}/categoryAttributeDefinitions", body, headers)
321
+ end
322
+
323
+ # Delete a category attribute definition
324
+ #
325
+ # @param kapp_slug [String] slug of the kapp where the category exists
326
+ # @param name [String] name of the attribute definition
327
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
328
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
329
+ def delete_category_attribute_definition(kapp_slug, name, headers=default_headers)
330
+ @logger.info("Deleting the \"#{name}\" Category attribute definition from the \"#{kapp_slug}\" kapp.")
331
+ delete("#{@api_url}/kapps/#{kapp_slug}/categoryAttributeDefinitions/#{encode(name)}", headers)
332
+ end
333
+
334
+ # Find a category attribute definition
335
+ #
336
+ # @param kapp_slug [String] slug of the kapp where the category exists
337
+ # @param name [String] name of the attribute definition
338
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
339
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
340
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
341
+ def find_category_attribute_definition(kapp_slug, name, params={}, headers=default_headers)
342
+ @logger.info("Finding the \"#{name}\" Category attribute definition in the \"#{kapp_slug}\" kapp.")
343
+ get("#{@api_url}/kapps/#{kapp_slug}/categoryAttributeDefinitions/#{encode(name)}", params, headers)
344
+ end
345
+
346
+ # Find all category attribute definition
347
+ #
348
+ # @param kapp_slug [String] slug of the kapp where the categories exist
349
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
350
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
351
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
352
+ def find_category_attribute_definitions(kapp_slug, params={}, headers=default_headers)
353
+ @logger.info("Finding Category attribute definitions in the \"#{kapp_slug}\" kapp.")
354
+ get("#{@api_url}/kapps/#{kapp_slug}/categoryAttributeDefinitions", params, headers)
355
+ end
356
+
357
+ # Update a category attribute definition
358
+ #
359
+ # @param kapp_slug [String] slug of the kapp where the category exists
360
+ # @param name [String] name of the attribute definition
361
+ # @param body [Hash] properties of the attribute definition to update
362
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
363
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
364
+ def update_category_attribute_definition(kapp_slug, name, body, headers=default_headers)
365
+ @logger.info("Updating the \"#{name}\" Category attribute definition in the \"#{kapp_slug}\" kapp.")
366
+ put("#{@api_url}/kapps/#{kapp_slug}/categoryAttributeDefinitions/#{encode(name)}",body, headers)
367
+ end
368
+
369
+ # Add a new form attribute definition.
370
+ #
371
+ # @param kapp_slug [String] slug of the kapp where the form exists
372
+ # @param name [String] name of the attribute definition
373
+ # @param description [String] description of the attribute definition
374
+ # @param allows_multiple [Boolean] whether the attribute allows multiple values
375
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
376
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
377
+ def add_form_attribute_definition(kapp_slug, name, description, allows_multiple, headers=default_headers)
378
+ body = {
379
+ "allowsMultiple" => allows_multiple,
380
+ "description" => description,
381
+ "name" => name
382
+ }
383
+ @logger.info("Adding Form attribute definition \"#{name}\" to the \"#{kapp_slug}\" kapp.")
384
+ # Create the attribute definition
385
+ post("#{@api_url}/kapps/#{kapp_slug}/formAttributeDefinitions", body, headers)
386
+ end
387
+
388
+ # Delete a form attribute definition
389
+ #
390
+ # @param kapp_slug [String] slug of the kapp where the form exists
391
+ # @param name [String] name of the attribute definition
392
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
393
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
394
+ def delete_form_attribute_definition(kapp_slug, name, headers=default_headers)
395
+ @logger.info("Deleting the \"#{name}\" Form attribute definition from the \"#{kapp_slug}\" kapp.")
396
+ delete("#{@api_url}/kapps/#{kapp_slug}/formAttributeDefinitions/#{encode(name)}", headers)
397
+ end
398
+
399
+ # Find a form attribute definition
400
+ #
401
+ # @param kapp_slug [String] slug of the kapp where the form exists
402
+ # @param name [String] name of the attribute definition
403
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
404
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
405
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
406
+ def find_form_attribute_definition(kapp_slug, name, params={}, headers=default_headers)
407
+ @logger.info("Finding the \"#{name}\" Form attribute definition in the \"#{kapp_slug}\" kapp.")
408
+ get("#{@api_url}/kapps/#{kapp_slug}/formAttributeDefinitions/#{encode(name)}", params, headers)
409
+ end
410
+
411
+ # Find all form attribute definition
412
+ #
413
+ # @param kapp_slug [String] slug of the kapp where the forms exist
414
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
415
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
416
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
417
+ def find_form_attribute_definitions(kapp_slug, params={}, headers=default_headers)
418
+ @logger.info("Finding Form attribute definitions in the \"#{kapp_slug}\" kapp.")
419
+ get("#{@api_url}/kapps/#{kapp_slug}/formAttributeDefinitions", params, headers)
420
+ end
421
+
422
+ # Update a form attribute definition
423
+ #
424
+ # @param kapp_slug [String] slug of the kapp where the form exists
425
+ # @param name [String] name of the attribute definition
426
+ # @param body [Hash] properties of the attribute definition to update
427
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
428
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
429
+ def update_form_attribute_definition(kapp_slug, name, body, headers=default_headers)
430
+ @logger.info("Updating the \"#{name}\" Form attribute definition in the \"#{kapp_slug}\" kapp.")
431
+ put("#{@api_url}/kapps/#{kapp_slug}/formAttributeDefinitions/#{encode(name)}",body, headers)
432
+ end
433
+
434
+ # Add a new kapp attribute definition.
435
+ #
436
+ # @param kapp_slug [String] slug of the kapp
437
+ # @param name [String] name of the attribute definition
438
+ # @param description [String] description of the attribute definition
439
+ # @param allows_multiple [Boolean] whether the attribute allows multiple values
440
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
441
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
442
+ def add_kapp_attribute_definition(kapp_slug, name, description, allows_multiple, headers=default_headers)
443
+ body = {
444
+ "allowsMultiple" => allows_multiple,
445
+ "description" => description,
446
+ "name" => name
447
+ }
448
+ @logger.info("Adding Kapp attribute definition \"#{name}\" to the \"#{kapp_slug}\" kapp.")
449
+ # Create the attribute definition
450
+ post("#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions", body, headers)
451
+ end
452
+
453
+ # Delete a kapp attribute definition
454
+ #
455
+ # @param kapp_slug [String] slug of the kapp
456
+ # @param name [String] name of the attribute definition
457
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
458
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
459
+ def delete_kapp_attribute_definition(kapp_slug, name, headers=default_headers)
460
+ @logger.info("Deleting the \"#{name}\" Kapp attribute definition from the \"#{kapp_slug}\" kapp.")
461
+ delete("#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions/#{encode(name)}", headers)
462
+ end
463
+
464
+ # Find a kapp attribute definition
465
+ #
466
+ # @param kapp_slug [String] slug of the kapp
467
+ # @param name [String] name of the attribute definition
468
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
469
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
470
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
471
+ def find_kapp_attribute_definition(kapp_slug, name, params={}, headers=default_headers)
472
+ @logger.info("Finding the \"#{name}\" Kapp attribute definition in the \"#{kapp_slug}\" kapp.")
473
+ get("#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions/#{encode(name)}", params, headers)
474
+ end
475
+
476
+ # Find all kapp attribute definition
477
+ #
478
+ # @param kapp_slug [String] slug of the kapp
479
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
480
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
481
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
482
+ def find_kapp_attribute_definitions(kapp_slug, params={}, headers=default_headers)
483
+ @logger.info("Finding Kapp attribute definitions in the \"#{kapp_slug}\" kapp.")
484
+ get("#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions", params, headers)
485
+ end
486
+
487
+ # Update a kapp attribute definition
488
+ #
489
+ # @param kapp_slug [String] slug of the kapp
490
+ # @param name [String] name of the attribute definition
491
+ # @param body [Hash] properties of the attribute definition to update
492
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
493
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
494
+ def update_kapp_attribute_definition(kapp_slug, name, body, headers=default_headers)
495
+ @logger.info("Updating the \"#{name}\" Kapp attribute definition in the \"#{kapp_slug}\" kapp.")
496
+ put("#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions/#{encode(name)}",body, headers)
497
+ end
498
+
499
+ end
500
+ end
@@ -0,0 +1,141 @@
1
+ module KineticSdk
2
+ class Core
3
+
4
+ # Add a Bridge
5
+ #
6
+ # @param body [Hash] properties associated to the Bridge
7
+ # - +adapterClass+
8
+ # - +name+
9
+ # - +slug+
10
+ # - +properties+
11
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
12
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
13
+ def add_bridge(body, headers=default_headers)
14
+ @logger.info("Adding the \"#{body['name']}\" bridge through proxy to the agent platform component.")
15
+ post("#{@proxy_url}/agent/app/api/v1/bridges", body, headers)
16
+ end
17
+
18
+ # Delete a Bridge
19
+ #
20
+ # @param slug [String] slug of the Bridge
21
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
22
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
23
+ def delete_bridge(slug, headers=default_headers)
24
+ @logger.info("Deleting the \"#{slug}\" bridge through proxy to the agent platform component.")
25
+ delete("#{@proxy_url}/agent/app/api/v1/bridges/#{slug}", headers)
26
+ end
27
+
28
+ # Find a list of bridges
29
+ #
30
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
31
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
32
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
33
+ def find_bridges(params={}, headers=default_headers)
34
+ @logger.info("Find bridges through proxy to the agent platform component.")
35
+ get("#{@proxy_url}/agent/app/api/v1/bridges", params, headers)
36
+ end
37
+
38
+ # Find a bridge
39
+ #
40
+ # @param slug [String] slug of the bridge
41
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
42
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
43
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
44
+ def find_bridge(slug, params={}, headers=default_headers)
45
+ @logger.info("Finding the \"#{slug}\" bridge through proxy to the agent platform component.")
46
+ get("#{@proxy_url}/agent/app/api/v1/bridges/#{slug}", params, headers)
47
+ end
48
+
49
+ # Update a bridge
50
+ #
51
+ # @param slug [String] slug of the bridge
52
+ # @param body [Hash] properties of the bridge to update
53
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
54
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
55
+ def update_bridge(slug, body={}, headers=default_headers)
56
+ @logger.info("Updating the \"#{slug}\" bridge through proxy to the agent platform component.")
57
+ put("#{@proxy_url}/agent/app/api/v1/bridges/#{slug}", body, headers)
58
+ end
59
+
60
+ # Add a Bridge Model
61
+ #
62
+ # @param body [Hash] optional properties associated to the Bridge Model
63
+ # - +name+
64
+ # - +status+
65
+ # - +activeMappingName+
66
+ # - +attributes+
67
+ # - +mappings+
68
+ # - +qualifications+
69
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
70
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
71
+ def add_bridge_model(body={}, headers=default_headers)
72
+ @logger.info("Adding the \"#{body['name']}\" Bridge Model and Mappings.")
73
+ post("#{@api_url}/models", body, headers)
74
+ end
75
+
76
+ # Delete a Bridge Model
77
+ #
78
+ # @param name [String] name of the Bridge Model
79
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
80
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
81
+ def delete_bridge_model(name, headers=default_headers)
82
+ @logger.info("Deleting the \"#{name}\" Bridge Model.")
83
+ delete("#{@api_url}/models/#{encode(name)}", headers)
84
+ end
85
+
86
+ # Find a list of bridge models
87
+ #
88
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
89
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
90
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
91
+ def find_bridge_models(params={}, headers=default_headers)
92
+ @logger.info("Find Bridge models.")
93
+ get("#{@api_url}/models", params, headers)
94
+ end
95
+
96
+ # Find a bridge model
97
+ #
98
+ # @param name [String] name of the bridge model
99
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
100
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
101
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
102
+ def find_bridge_model(name, params={}, headers=default_headers)
103
+ @logger.info("Finding the \"#{name}\" Bridge Model.")
104
+ get("#{@api_url}/models/#{encode(name)}", params, headers)
105
+ end
106
+
107
+ # Update a Bridge Model
108
+ #
109
+ # @param name [String] name of the bridge model
110
+ # @param body [Hash] optional properties associated to the Bridge Model
111
+ # - +name+
112
+ # - +status+
113
+ # - +activeMappingName+
114
+ # - +attributes+
115
+ # - +mappings+
116
+ # - +qualifications+
117
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
118
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
119
+ def update_bridge_model(name, body={}, headers=default_headers)
120
+ @logger.info("Updating the \"#{name}\" Bridge Model.")
121
+ put("#{@api_url}/models/#{encode(name)}", body, headers)
122
+ end
123
+
124
+ # Update a Bridge Model Mapping
125
+ #
126
+ # @param model_name [String] name of the bridge model
127
+ # @param mapping_name [String] name of the bridge model mapping
128
+ # @param body [Hash] optional properties associated to the Bridge Model Mapping
129
+ # - +name+
130
+ # - +bridgeSlug+
131
+ # - +structure+
132
+ # - +attributes+
133
+ # - +qualifications+
134
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
135
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
136
+ def update_bridge_model_mapping(model_name, mapping_name, body={}, headers=default_headers)
137
+ @logger.info("Updating the \"#{model_name} - #{mapping_name}\" Bridge Model Mapping.")
138
+ put("#{@api_url}/models/#{encode(model_name)}/mappings/#{encode(mapping_name)}", body, headers)
139
+ end
140
+ end
141
+ end
@@ -1,5 +1,5 @@
1
1
  module KineticSdk
2
- class RequestCe
2
+ class Core
3
3
 
4
4
  # Add a category on a Kapp
5
5
  #
@@ -10,7 +10,7 @@ module KineticSdk
10
10
  # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
11
11
  def add_category_on_kapp(kapp_slug, body, headers=default_headers)
12
12
  raise StandardError.new "Category properties is not valid, must be a Hash." unless body.is_a? Hash
13
- info("Adding Category \"#{body['name']}\" for \"#{kapp_slug}\" kapp")
13
+ @logger.info("Adding Category \"#{body['name']}\" for \"#{kapp_slug}\" kapp")
14
14
  post("#{@api_url}/kapps/#{kapp_slug}/categories", body, headers)
15
15
  end
16
16
 
@@ -26,7 +26,7 @@ module KineticSdk
26
26
  # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
27
27
  def add_categorization_on_form(kapp_slug, body, headers=default_headers)
28
28
  raise StandardError.new "Category properties is not valid, must be a Hash." unless body.is_a? Hash
29
- info("Adding Categorization for \"#{kapp_slug}\" kapp")
29
+ @logger.info("Adding Categorization for \"#{kapp_slug}\" kapp")
30
30
  post("#{@api_url}/kapps/#{kapp_slug}/categorizations", body, headers)
31
31
  end
32
32