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
@@ -1,89 +0,0 @@
1
- module KineticSdk
2
- class RequestCe
3
-
4
- # Add an attribute value to the space, or update an attribute if it already exists
5
- #
6
- # @param attribute_name [String] name of the attribute
7
- # @param attribute_value [String] value of the attribute
8
- # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
9
- # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
10
- def add_space_attribute(attribute_name, attribute_value, headers=default_headers)
11
- # first find the space
12
- response = find_space({ "include" => "attributes"}, headers)
13
- # hack to try a second time if space isn't found
14
- if response.status == 404
15
- sleep 2
16
- response = find_space({ "include" => "attributes"}, headers)
17
- end
18
- space = response.content["space"]
19
- attributes = space["attributes"]
20
- # either add or update the attribute value
21
- exists = false
22
- attributes.each do |attribute|
23
- info("Attribute: #{attribute.inspect}")
24
- # if the attribute already exists, update it
25
- if attribute["name"] == attribute_name
26
- attribute["values"] = [ attribute_value ]
27
- exists = true
28
- end
29
- end
30
- # add the attribute if it didn't exist
31
- attributes.push({
32
- "name" => attribute_name,
33
- "values" => [ attribute_value ]
34
- }) unless exists
35
-
36
- # set the updated attributes list
37
- body = { "attributes" => attributes }
38
- if exists
39
- info("Updating attribute \"#{attribute_name}\" = \"#{attribute_value}\" in the \"#{space_slug}\" space.")
40
- else
41
- info("Adding attribute \"#{attribute_name}\" = \"#{attribute_value}\" to the \"#{space_slug}\" space.")
42
- end
43
- # Update the space
44
- put("#{@api_url}/space", body, headers)
45
- end
46
-
47
- # Update a space
48
- #
49
- # @param body [Hash] properties for the Space
50
- # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
51
- # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
52
- def update_space(body={}, headers=default_headers)
53
- info("Updating Space \"#{@space_slug}\"")
54
- put("#{@api_url}/space", body, headers)
55
- end
56
-
57
- # Export a space
58
- #
59
- # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
60
- # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
61
- def export_space(headers=default_headers)
62
- info("Exporting Space \"#{@space_slug}\"")
63
- get("#{@api_url}/space", { 'export' => true}, headers)
64
- end
65
-
66
- # Find the space
67
- #
68
- # @param params [Hash] Query parameters that are added to the URL, such as +include+
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 find_space(params={}, headers=default_headers)
72
- info("Finding Space \"#{@space_slug}\"")
73
- get("#{@api_url}/space", params, headers)
74
- end
75
-
76
- # Checks if the space exists
77
- #
78
- # @param slug [String] slug of the space
79
- # @param params [Hash] Query parameters that are added to the URL, such as +include+
80
- # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
81
- # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
82
- def space_exists?(slug, params={}, headers=default_headers)
83
- info("Checking if the \"#{slug}\" space exists")
84
- response = get("#{@api_url}/spaces/#{slug}", params, headers)
85
- response.status == 200
86
- end
87
-
88
- end
89
- end