kinetic_sdk 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/GettingStarted.md +64 -0
- data/README.md +383 -0
- data/bin/console +12 -0
- data/bin/setup +8 -0
- data/gems/kontena-websocket-client-0.1.1/Gemfile +4 -0
- data/gems/kontena-websocket-client-0.1.1/LICENSE +190 -0
- data/gems/kontena-websocket-client-0.1.1/README.md +138 -0
- data/gems/kontena-websocket-client-0.1.1/Rakefile +6 -0
- data/gems/kontena-websocket-client-0.1.1/benchmark/benchmark-client.rb +45 -0
- data/gems/kontena-websocket-client-0.1.1/benchmark/benchmark-em.rb +66 -0
- data/gems/kontena-websocket-client-0.1.1/benchmark/benchmark.rb +161 -0
- data/gems/kontena-websocket-client-0.1.1/benchmark/benchmark.sh +17 -0
- data/gems/kontena-websocket-client-0.1.1/benchmark/websocket-echo-server.go +207 -0
- data/gems/kontena-websocket-client-0.1.1/examples/websocket-echo-client.rb +80 -0
- data/gems/kontena-websocket-client-0.1.1/kontena-websocket-client.gemspec +24 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena/websocket/client/connection.rb +119 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena/websocket/client/version.rb +13 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena/websocket/client.rb +848 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena/websocket/error.rb +81 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena/websocket/logging.rb +55 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena/websocket/openssl_patch.rb +10 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena-websocket-client.rb +15 -0
- data/gems/mime-types-3.1/Code-of-Conduct.rdoc +74 -0
- data/gems/mime-types-3.1/Contributing.rdoc +130 -0
- data/gems/mime-types-3.1/History.rdoc +658 -0
- data/gems/mime-types-3.1/Licence.rdoc +25 -0
- data/gems/mime-types-3.1/Manifest.txt +31 -0
- data/gems/mime-types-3.1/README.rdoc +202 -0
- data/gems/mime-types-3.1/Rakefile +254 -0
- data/gems/mime-types-3.1/lib/mime/type/columnar.rb +55 -0
- data/gems/mime-types-3.1/lib/mime/type.rb +573 -0
- data/gems/mime-types-3.1/lib/mime/types/_columnar.rb +135 -0
- data/gems/mime-types-3.1/lib/mime/types/cache.rb +56 -0
- data/gems/mime-types-3.1/lib/mime/types/columnar.rb +1 -0
- data/gems/mime-types-3.1/lib/mime/types/container.rb +30 -0
- data/gems/mime-types-3.1/lib/mime/types/deprecations.rb +32 -0
- data/gems/mime-types-3.1/lib/mime/types/full.rb +17 -0
- data/gems/mime-types-3.1/lib/mime/types/loader.rb +148 -0
- data/gems/mime-types-3.1/lib/mime/types/logger.rb +37 -0
- data/gems/mime-types-3.1/lib/mime/types/registry.rb +81 -0
- data/gems/mime-types-3.1/lib/mime/types.rb +228 -0
- data/gems/mime-types-3.1/lib/mime-types.rb +1 -0
- data/gems/mime-types-3.1/test/bad-fixtures/malformed +9 -0
- data/gems/mime-types-3.1/test/fixture/json.json +1 -0
- data/gems/mime-types-3.1/test/fixture/old-data +9 -0
- data/gems/mime-types-3.1/test/fixture/yaml.yaml +55 -0
- data/gems/mime-types-3.1/test/minitest_helper.rb +13 -0
- data/gems/mime-types-3.1/test/test_mime_type.rb +603 -0
- data/gems/mime-types-3.1/test/test_mime_types.rb +161 -0
- data/gems/mime-types-3.1/test/test_mime_types_cache.rb +109 -0
- data/gems/mime-types-3.1/test/test_mime_types_class.rb +155 -0
- data/gems/mime-types-3.1/test/test_mime_types_lazy.rb +43 -0
- data/gems/mime-types-3.1/test/test_mime_types_loader.rb +32 -0
- data/gems/mime-types-data-3.2016.0521/Code-of-Conduct.md +75 -0
- data/gems/mime-types-data-3.2016.0521/Contributing.md +157 -0
- data/gems/mime-types-data-3.2016.0521/History.md +351 -0
- data/gems/mime-types-data-3.2016.0521/Licence.md +25 -0
- data/gems/mime-types-data-3.2016.0521/Manifest.txt +18 -0
- data/gems/mime-types-data-3.2016.0521/README.md +61 -0
- data/gems/mime-types-data-3.2016.0521/Rakefile +80 -0
- data/gems/mime-types-data-3.2016.0521/data/mime-types.json +1 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.content_type.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.docs.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.encoding.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.flags.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.friendly.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.pext.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.use_instead.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.xrefs.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/lib/mime/types/data.rb +21 -0
- data/gems/mime-types-data-3.2016.0521/lib/mime-types-data.rb +3 -0
- data/gems/multipart-post-2.0.0/Gemfile +14 -0
- data/gems/multipart-post-2.0.0/History.txt +60 -0
- data/gems/multipart-post-2.0.0/Manifest.txt +9 -0
- data/gems/multipart-post-2.0.0/README.md +77 -0
- data/gems/multipart-post-2.0.0/Rakefile +9 -0
- data/gems/multipart-post-2.0.0/lib/composite_io.rb +108 -0
- data/gems/multipart-post-2.0.0/lib/multipart_post.rb +9 -0
- data/gems/multipart-post-2.0.0/lib/multipartable.rb +29 -0
- data/gems/multipart-post-2.0.0/lib/net/http/post/multipart.rb +27 -0
- data/gems/multipart-post-2.0.0/lib/parts.rb +96 -0
- data/gems/multipart-post-2.0.0/multipart-post.gemspec +22 -0
- data/gems/multipart-post-2.0.0/test/multibyte.txt +1 -0
- data/gems/multipart-post-2.0.0/test/net/http/post/test_multipart.rb +110 -0
- data/gems/multipart-post-2.0.0/test/test_composite_io.rb +115 -0
- data/gems/multipart-post-2.0.0/test/test_parts.rb +86 -0
- data/gems/parallel-1.12.1/MIT-LICENSE.txt +20 -0
- data/gems/parallel-1.12.1/lib/parallel/processor_count.rb +93 -0
- data/gems/parallel-1.12.1/lib/parallel/version.rb +3 -0
- data/gems/parallel-1.12.1/lib/parallel.rb +500 -0
- data/gems/ruby-progressbar-1.9.0/LICENSE.txt +19 -0
- data/gems/ruby-progressbar-1.9.0/README.md +38 -0
- data/gems/ruby-progressbar-1.9.0/Rakefile +2 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/base.rb +183 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/calculators/length.rb +99 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/calculators/running_average.rb +9 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/components/bar.rb +96 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/components/percentage.rb +29 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/components/rate.rb +43 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/components/time.rb +107 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/components/title.rb +13 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/components.rb +5 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/errors/invalid_progress_error.rb +4 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/format/formatter.rb +27 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/format/molecule.rb +59 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/format/string.rb +36 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/format.rb +3 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/output.rb +68 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/outputs/non_tty.rb +47 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/outputs/null.rb +33 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/outputs/tty.rb +32 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/progress.rb +118 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/refinements/enumerator.rb +25 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/refinements.rb +1 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/throttle.rb +25 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/time.rb +30 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/timer.rb +72 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/version.rb +3 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar.rb +18 -0
- data/gems/slugify-1.0.7/README +18 -0
- data/gems/slugify-1.0.7/lib/slugify.rb +1012 -0
- data/gems/slugify-1.0.7/lib/slugify_string.rb +11 -0
- data/gems/slugify-1.0.7/tests/slugify_test.rb +116 -0
- data/gems/slugify-1.0.7/tests/string_slugify_test.rb +23 -0
- data/gems/websocket-driver-0.6.5/CHANGELOG.md +123 -0
- data/gems/websocket-driver-0.6.5/LICENSE.md +22 -0
- data/gems/websocket-driver-0.6.5/README.md +369 -0
- data/gems/websocket-driver-0.6.5/examples/tcp_server.rb +28 -0
- data/gems/websocket-driver-0.6.5/ext/websocket-driver/Makefile +264 -0
- data/gems/websocket-driver-0.6.5/ext/websocket-driver/WebsocketMaskService.java +55 -0
- data/gems/websocket-driver-0.6.5/ext/websocket-driver/extconf.rb +4 -0
- data/gems/websocket-driver-0.6.5/ext/websocket-driver/websocket_mask.bundle +0 -0
- data/gems/websocket-driver-0.6.5/ext/websocket-driver/websocket_mask.c +41 -0
- data/gems/websocket-driver-0.6.5/ext/websocket-driver/websocket_mask.o +0 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/client.rb +140 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/draft75.rb +102 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/draft76.rb +96 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/event_emitter.rb +54 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/headers.rb +45 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/hybi/frame.rb +20 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/hybi/message.rb +31 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/hybi.rb +406 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/proxy.rb +68 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/server.rb +80 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/stream_reader.rb +55 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver.rb +199 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/http/headers.rb +112 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/http/request.rb +45 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/http/response.rb +29 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/http.rb +15 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/mask.rb +14 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/websocket_mask.rb +2 -0
- data/gems/websocket-driver-0.6.5/lib/websocket_mask.bundle +0 -0
- data/gems/websocket-driver-0.6.5-java/CHANGELOG.md +123 -0
- data/gems/websocket-driver-0.6.5-java/LICENSE.md +22 -0
- data/gems/websocket-driver-0.6.5-java/README.md +369 -0
- data/gems/websocket-driver-0.6.5-java/examples/tcp_server.rb +28 -0
- data/gems/websocket-driver-0.6.5-java/ext/websocket-driver/WebsocketMaskService.java +55 -0
- data/gems/websocket-driver-0.6.5-java/ext/websocket-driver/extconf.rb +4 -0
- data/gems/websocket-driver-0.6.5-java/ext/websocket-driver/websocket_mask.c +41 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/client.rb +140 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/draft75.rb +102 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/draft76.rb +96 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/event_emitter.rb +54 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/headers.rb +45 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/hybi/frame.rb +20 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/hybi/message.rb +31 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/hybi.rb +406 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/proxy.rb +68 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/server.rb +80 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/stream_reader.rb +55 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver.rb +199 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/http/headers.rb +112 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/http/request.rb +45 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/http/response.rb +29 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/http.rb +15 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/mask.rb +14 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/websocket_mask.rb +2 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket_mask.jar +0 -0
- data/gems/websocket-extensions-0.1.3/CHANGELOG.md +15 -0
- data/gems/websocket-extensions-0.1.3/LICENSE.md +20 -0
- data/gems/websocket-extensions-0.1.3/README.md +313 -0
- data/gems/websocket-extensions-0.1.3/lib/websocket/extensions/parser.rb +111 -0
- data/gems/websocket-extensions-0.1.3/lib/websocket/extensions.rb +181 -0
- data/lib/kinetic-sdk.rb +1 -0
- data/lib/kinetic_sdk/bridgehub/bridgehub-sdk.rb +80 -0
- data/lib/kinetic_sdk/bridgehub/lib/access_keys.rb +67 -0
- data/lib/kinetic_sdk/bridgehub/lib/bridge.rb +69 -0
- data/lib/kinetic_sdk/discussions/discussions-sdk.rb +165 -0
- data/lib/kinetic_sdk/discussions/lib/discussions.rb +107 -0
- data/lib/kinetic_sdk/discussions/lib/invitations.rb +120 -0
- data/lib/kinetic_sdk/discussions/lib/messages.rb +190 -0
- data/lib/kinetic_sdk/discussions/lib/meta.rb +14 -0
- data/lib/kinetic_sdk/discussions/lib/participants.rb +64 -0
- data/lib/kinetic_sdk/discussions/lib/related_items.rb +54 -0
- data/lib/kinetic_sdk/discussions/lib/websockets.rb +96 -0
- data/lib/kinetic_sdk/filehub/filehub-sdk.rb +80 -0
- data/lib/kinetic_sdk/filehub/lib/access_keys.rb +67 -0
- data/lib/kinetic_sdk/filehub/lib/filestores.rb +67 -0
- data/lib/kinetic_sdk/request_ce/lib/attribute_definitions.rb +153 -0
- data/lib/kinetic_sdk/request_ce/lib/bridges.rb +66 -0
- data/lib/kinetic_sdk/request_ce/lib/categories.rb +34 -0
- data/lib/kinetic_sdk/request_ce/lib/datastore_form.rb +110 -0
- data/lib/kinetic_sdk/request_ce/lib/datastore_submissions.rb +157 -0
- data/lib/kinetic_sdk/request_ce/lib/form.rb +99 -0
- data/lib/kinetic_sdk/request_ce/lib/form_types.rb +51 -0
- data/lib/kinetic_sdk/request_ce/lib/jwt.rb +55 -0
- data/lib/kinetic_sdk/request_ce/lib/kapp.rb +93 -0
- data/lib/kinetic_sdk/request_ce/lib/meta.rb +14 -0
- data/lib/kinetic_sdk/request_ce/lib/oauth.rb +37 -0
- data/lib/kinetic_sdk/request_ce/lib/security_policy_definitions.rb +157 -0
- data/lib/kinetic_sdk/request_ce/lib/space.rb +89 -0
- data/lib/kinetic_sdk/request_ce/lib/submissions.rb +215 -0
- data/lib/kinetic_sdk/request_ce/lib/system_api.rb +69 -0
- data/lib/kinetic_sdk/request_ce/lib/teams.rb +113 -0
- data/lib/kinetic_sdk/request_ce/lib/users.rb +245 -0
- data/lib/kinetic_sdk/request_ce/lib/webhook_jobs.rb +142 -0
- data/lib/kinetic_sdk/request_ce/lib/webhooks.rb +192 -0
- data/lib/kinetic_sdk/request_ce/request-ce-sdk.rb +153 -0
- data/lib/kinetic_sdk/task/lib/access_keys.rb +94 -0
- data/lib/kinetic_sdk/task/lib/categories.rb +190 -0
- data/lib/kinetic_sdk/task/lib/config.rb +202 -0
- data/lib/kinetic_sdk/task/lib/engine.rb +42 -0
- data/lib/kinetic_sdk/task/lib/environment.rb +14 -0
- data/lib/kinetic_sdk/task/lib/errors.rb +165 -0
- data/lib/kinetic_sdk/task/lib/groups.rb +112 -0
- data/lib/kinetic_sdk/task/lib/handlers.rb +105 -0
- data/lib/kinetic_sdk/task/lib/health.rb +28 -0
- data/lib/kinetic_sdk/task/lib/license.rb +52 -0
- data/lib/kinetic_sdk/task/lib/policy_rules.rb +166 -0
- data/lib/kinetic_sdk/task/lib/setup.rb +56 -0
- data/lib/kinetic_sdk/task/lib/sources.rb +134 -0
- data/lib/kinetic_sdk/task/lib/tasks.rb +17 -0
- data/lib/kinetic_sdk/task/lib/trees.rb +274 -0
- data/lib/kinetic_sdk/task/lib/users.rb +75 -0
- data/lib/kinetic_sdk/task/task-sdk.rb +92 -0
- data/lib/kinetic_sdk/utils/kinetic-http-headers.rb +150 -0
- data/lib/kinetic_sdk/utils/kinetic-http-response.rb +75 -0
- data/lib/kinetic_sdk/utils/kinetic-http.rb +552 -0
- data/lib/kinetic_sdk/utils/logger.rb +70 -0
- data/lib/kinetic_sdk/utils/random.rb +30 -0
- data/lib/kinetic_sdk/version.rb +7 -0
- data/lib/kinetic_sdk.rb +57 -0
- metadata +414 -0
@@ -0,0 +1,67 @@
|
|
1
|
+
module KineticSdk
|
2
|
+
class Bridgehub
|
3
|
+
|
4
|
+
# Add an Access Key for a Bridge
|
5
|
+
#
|
6
|
+
# @param slug [String] slug of the bridge
|
7
|
+
# @param payload [Hash] properties for the access key
|
8
|
+
# - +description+
|
9
|
+
# - +id+
|
10
|
+
# - +secret+
|
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_access_key(slug, payload, headers=default_headers)
|
14
|
+
info("Adding Access Key for Bridge \"#{slug}\"")
|
15
|
+
post("#{@api_url}/bridges/#{slug}/access-keys", payload, headers)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Delete an Access Key for a Bridge
|
19
|
+
#
|
20
|
+
# @param slug [String] slug of the bridge
|
21
|
+
# @param id [String] id (key) of the access key
|
22
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
23
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
24
|
+
def delete_access_key(slug, id, headers=default_headers)
|
25
|
+
info("Deleting Access Key #{id} for Bridge \"#{slug}\"")
|
26
|
+
delete("#{@api_url}/bridges/#{slug}/access-keys/#{id}", headers)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Find Access Keys for a Bridge
|
30
|
+
#
|
31
|
+
# @param slug [String] slug of the bridge
|
32
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
33
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
34
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
35
|
+
def find_access_keys(slug, params={}, headers=default_headers)
|
36
|
+
info("Finding Access Keys for Bridge \"#{slug}\"")
|
37
|
+
get("#{@api_url}/bridges/#{slug}/access-keys", params, headers)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Find an Access Key for a Bridge
|
41
|
+
#
|
42
|
+
# @param slug [String] slug of the bridge
|
43
|
+
# @param id [String] id (key) of the access key
|
44
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
45
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
46
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
47
|
+
def find_access_key(slug, id, params={}, headers=default_headers)
|
48
|
+
info("Finding Access Key \"#{id}\" for Bridge \"#{slug}\"")
|
49
|
+
get("#{@api_url}/bridges/#{slug}/access-keys/#{id}", params, headers)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Update a Bridge Access Key
|
53
|
+
#
|
54
|
+
# @param slug [String] slug of the bridge
|
55
|
+
# @param id [String] id (key) of the access key
|
56
|
+
# @param payload [Hash] properties for the access key
|
57
|
+
# - +description+
|
58
|
+
# - +secret+
|
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 update_access_key(slug, id, payload, headers=default_headers)
|
62
|
+
info("Updating Access Key \"#{id}\" for Bridge \"#{slug}\"")
|
63
|
+
put("#{@api_url}/bridges/#{slug}/access-keys/#{id}", payload, headers)
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
module KineticSdk
|
2
|
+
class Bridgehub
|
3
|
+
|
4
|
+
# Add a Bridge
|
5
|
+
#
|
6
|
+
# @param payload [Hash] properties for the bridge
|
7
|
+
# - +adapterClass+
|
8
|
+
# - +name+
|
9
|
+
# - +slug+
|
10
|
+
# - +ipAddresses+
|
11
|
+
# - +useAccessKeys+
|
12
|
+
# - +properties+
|
13
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
14
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
15
|
+
def add_bridge(payload, headers=default_headers)
|
16
|
+
info("Adding Bridge \"#{payload['name']}\" with slug \"#{payload['slug']}\"")
|
17
|
+
post("#{@api_url}/bridges", payload, headers)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Delete a Bridge
|
21
|
+
#
|
22
|
+
# @param slug [String] slug of the bridge
|
23
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
24
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
25
|
+
def delete_bridge(slug, headers=default_headers)
|
26
|
+
info("Deleting Bridge \"#{slug}\"")
|
27
|
+
delete("#{@api_url}/bridges/#{slug}", headers)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Find Bridges
|
31
|
+
#
|
32
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
33
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
34
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
35
|
+
def find_bridges(params={}, headers=default_headers)
|
36
|
+
info("Finding Bridges")
|
37
|
+
get("#{@api_url}/bridges", params, headers)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Find a Bridge
|
41
|
+
#
|
42
|
+
# @param slug [String] slug of the bridge
|
43
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
44
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
45
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
46
|
+
def find_bridge(slug, params={}, headers=default_headers)
|
47
|
+
info("Finding Bridge \"#{slug}\"")
|
48
|
+
get("#{@api_url}/bridges/#{slug}", params, headers)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Update a Bridge
|
52
|
+
#
|
53
|
+
# @param slug [String] slug of the bridge
|
54
|
+
# @param payload [Hash] properties for the bridge
|
55
|
+
# - +adapterClass+
|
56
|
+
# - +name+
|
57
|
+
# - +slug+
|
58
|
+
# - +ipAddresses+
|
59
|
+
# - +useAccessKeys+
|
60
|
+
# - +properties+
|
61
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
62
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
63
|
+
def update_bridge(slug, payload, headers=default_headers)
|
64
|
+
info("Updating Bridge \"#{slug}\"")
|
65
|
+
put("#{@api_url}/bridges/#{slug}", payload, headers)
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,165 @@
|
|
1
|
+
Dir[File.join(File.dirname(File.expand_path(__FILE__)), "lib", "**", "*.rb")].each {|file| require file }
|
2
|
+
|
3
|
+
module KineticSdk
|
4
|
+
|
5
|
+
# Discussions is a Ruby class that acts as a wrapper for the Kinetic Discussions REST API
|
6
|
+
# without having to make explicit HTTP requests.
|
7
|
+
#
|
8
|
+
class Discussions
|
9
|
+
|
10
|
+
# Include the KineticHttpUtils module
|
11
|
+
include KineticSdk::Utils::KineticHttpUtils
|
12
|
+
|
13
|
+
attr_reader :api_url, :username, :jwt, :options, :space_slug,
|
14
|
+
:server, :topics_ws_server, :version
|
15
|
+
|
16
|
+
# Initalize the Discussions SDK with the web server URL and configuration user
|
17
|
+
# credentials, along with any custom option values.
|
18
|
+
#
|
19
|
+
# @param opts [Hash] Kinetic Discussions properties
|
20
|
+
# @option opts [String] :config_file optional - path to the YAML configuration file
|
21
|
+
#
|
22
|
+
# * Ex: /opt/config/discussions-configuration1.yaml
|
23
|
+
#
|
24
|
+
# @option opts [String] :app_server_url the URL to the Kinetic Request CE web space
|
25
|
+
#
|
26
|
+
# * Ex: <http://192.168.0.1:8080/kinetic/acme> - space slug (`acme`)
|
27
|
+
# * Ex: <http://acme.server.io/kinetic> - space slug (`acme`) as subdomain
|
28
|
+
#
|
29
|
+
# @option opts [String] :space_slug the slug that identifies the Space
|
30
|
+
# @option opts [String] :username the username for the user
|
31
|
+
# @option opts [String] :password the password for the user
|
32
|
+
# @option opts [Hash<Symbol, Object>] :options ({}) optional settings
|
33
|
+
#
|
34
|
+
# * :log_level (String) (_defaults to: off_) level of logging - off | info | debug | trace
|
35
|
+
# * :export_directory (String) (_example: /opt/exports/kinetic-task) directory to write file attachments when exporting,
|
36
|
+
# * :max_redirects (Fixnum) (_defaults to: 10_) maximum number of redirects to follow
|
37
|
+
# * :oauth_client_id (String) id of the Kinetic Core oauth client
|
38
|
+
# * :oauth_client_secret (String) secret of the Kinetic Core oauth client
|
39
|
+
# * :ssl_ca_file (String) full path to PEM certificate used to verify the server
|
40
|
+
# * :ssl_verify_mode (String) (_defaults to: none_) - none | peer
|
41
|
+
#
|
42
|
+
# Example: using a configuration file
|
43
|
+
#
|
44
|
+
# KineticSdk::Discussions.new({
|
45
|
+
# config_file: "/opt/config1.yaml"
|
46
|
+
# })
|
47
|
+
#
|
48
|
+
# Example: space user properties hash
|
49
|
+
#
|
50
|
+
# KineticSdk::Discussions.new({
|
51
|
+
# app_server_url: "http://localhost:8080",
|
52
|
+
# space: "foo",
|
53
|
+
# username: "admin",
|
54
|
+
# password: "admin",
|
55
|
+
# options: {
|
56
|
+
# log_level: "debug",
|
57
|
+
# export_directory: "/opt/exports/discussions",
|
58
|
+
# oauth_client_id: "my-oauth-client-id",
|
59
|
+
# oauth_client_secret: "secret",
|
60
|
+
# ssl_verify_mode: "peer",
|
61
|
+
# ssl_ca_file: "/usr/local/self_signing_ca.pem"
|
62
|
+
# }
|
63
|
+
# })
|
64
|
+
#
|
65
|
+
#
|
66
|
+
# Example: system user properties hash
|
67
|
+
#
|
68
|
+
# KineticSdk::Discussions.new({
|
69
|
+
# app_server_url: "http://localhost:8080",
|
70
|
+
# username: "admin",
|
71
|
+
# password: "password",
|
72
|
+
# options: {
|
73
|
+
# log_level: "debug",
|
74
|
+
# oauth_client_id: "my-oauth-client-id",
|
75
|
+
# oauth_client_secret: "secret",
|
76
|
+
# ssl_verify_mode: "peer",
|
77
|
+
# ssl_ca_file: "/usr/local/self_signing_ca.pem"
|
78
|
+
# }
|
79
|
+
# })
|
80
|
+
#
|
81
|
+
#
|
82
|
+
# If the +config_file+ option is present, it will be loaded first, and any additional
|
83
|
+
# options will overwrite any values in the config file
|
84
|
+
#
|
85
|
+
def initialize(opts)
|
86
|
+
# initialize any variables
|
87
|
+
options = {}
|
88
|
+
|
89
|
+
# process the configuration file if it was provided
|
90
|
+
unless opts[:config_file].nil?
|
91
|
+
options.merge!(YAML::load_file opts[:config_file])
|
92
|
+
end
|
93
|
+
|
94
|
+
# process the configuration hash if it was provided
|
95
|
+
options.merge!(opts)
|
96
|
+
|
97
|
+
# allow either :app_server_url or :space_server_url, but not both
|
98
|
+
if options[:app_server_url] && options[:space_server_url]
|
99
|
+
raise StandardError.new "Expecting one of :app_server_url or :space_server_url, but not both."
|
100
|
+
end
|
101
|
+
if options[:app_server_url].nil? && options[:space_server_url].nil?
|
102
|
+
raise StandardError.new "Expecting one of :app_server_url or :space_server_url."
|
103
|
+
end
|
104
|
+
|
105
|
+
# process any individual options
|
106
|
+
@options = options[:options] || {}
|
107
|
+
@username = options[:username]
|
108
|
+
@space_slug = options[:space_slug]
|
109
|
+
|
110
|
+
if options[:topics_server_url]
|
111
|
+
@topics_ws_server = "#{options[:topics_server_url].gsub('http', 'ws')}/#{@space_slug}/socket"
|
112
|
+
end
|
113
|
+
|
114
|
+
if options[:discussions_server_url]
|
115
|
+
@server = options[:discussions_server_url].chomp('/')
|
116
|
+
@api_url = "#{@server}/#{@space_slug}/app/api/v1"
|
117
|
+
if @topics_ws_server.nil?
|
118
|
+
@topics_ws_server = "#{@server.gsub('http', 'ws')}/app/topics/socket"
|
119
|
+
end
|
120
|
+
elsif options[:app_server_url]
|
121
|
+
@server = options[:app_server_url].chomp('/')
|
122
|
+
@api_url = "#{@server}/#{@space_slug}/app/api/v1"
|
123
|
+
if @topics_ws_server.nil?
|
124
|
+
@topics_ws_server = "#{@server.gsub('http', 'ws')}/#{@space_slug}/app/topics/socket"
|
125
|
+
end
|
126
|
+
else
|
127
|
+
raise StandardError.new "The :space_slug option is required when using the :space_server_url option" if @space_slug.nil?
|
128
|
+
@server = options[:space_server_url].chomp('/')
|
129
|
+
@api_url = "#{@server}/app/discussions/api/v1"
|
130
|
+
if @topics_ws_server.nil?
|
131
|
+
@topics_ws_server = "#{@server.gsub('http', 'ws')}/app/topics/socket"
|
132
|
+
end
|
133
|
+
end
|
134
|
+
@jwt = @space_slug.nil? ? nil : generate_jwt(options)
|
135
|
+
@version = 1
|
136
|
+
end
|
137
|
+
|
138
|
+
# Generate a JWT for bearer authentication based on the user credentials,
|
139
|
+
# and oauth client configuration.
|
140
|
+
def generate_jwt(options={})
|
141
|
+
oauth_client_id = options[:options][:oauth_client_id]
|
142
|
+
oauth_client_secret = options[:options][:oauth_client_secret]
|
143
|
+
|
144
|
+
jwt_response = kinetic_core_sdk(options).jwt_token(oauth_client_id, oauth_client_secret)
|
145
|
+
jwt_response.content['access_token']
|
146
|
+
end
|
147
|
+
|
148
|
+
# Creates a reference to the Kinetic Request CE SDK
|
149
|
+
def kinetic_core_sdk(options)
|
150
|
+
kinetic_core_options = {
|
151
|
+
space_slug: options[:space_slug],
|
152
|
+
username: options[:username],
|
153
|
+
password: options[:password],
|
154
|
+
options: options[:options] || {}
|
155
|
+
}
|
156
|
+
if options[:app_server_url]
|
157
|
+
kinetic_core_options[:app_server_url] = options[:app_server_url]
|
158
|
+
else
|
159
|
+
kinetic_core_options[:space_server_url] = options[:space_server_url]
|
160
|
+
end
|
161
|
+
KineticSdk::RequestCe.new(kinetic_core_options)
|
162
|
+
end
|
163
|
+
|
164
|
+
end
|
165
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
module KineticSdk
|
2
|
+
class Discussions
|
3
|
+
|
4
|
+
# Add a Discussion
|
5
|
+
#
|
6
|
+
# @param properties [Hash] discussion properties
|
7
|
+
# - +title+ [String]
|
8
|
+
# - +description+ [String]
|
9
|
+
# - +joinPolicy+ [String] name of the security policy that defines who can join
|
10
|
+
# - +owningUsers+ [Array] array of user usernames
|
11
|
+
# - +owningTeams+ [Array] array of team names
|
12
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication and accept JSON content type
|
13
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
14
|
+
def add_discussion(properties={}, headers=default_jwt_headers)
|
15
|
+
info("Adding the #{properties['title']} discussion")
|
16
|
+
post("#{@api_url}/discussions", properties, headers)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Delete a Discussion
|
20
|
+
#
|
21
|
+
# @param discussion_id [String] discussion_id of the discussion
|
22
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication
|
23
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
24
|
+
def delete_discussion(discussion_id, headers=header_bearer_auth)
|
25
|
+
info("Deleting Discussion \"#{discussion_id}\"")
|
26
|
+
delete("#{@api_url}/discussions/#{discussion_id}", headers)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Find Discussions
|
30
|
+
#
|
31
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
32
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication and accept JSON content type
|
33
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
34
|
+
def find_discussions(params={}, headers=default_jwt_headers)
|
35
|
+
info("Finding Discussions.")
|
36
|
+
get("#{@api_url}/discussions", params, headers)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Find a Discussion
|
40
|
+
#
|
41
|
+
# @param discussion_id [String] id of the Discussion
|
42
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
43
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication and accept JSON content type
|
44
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
45
|
+
def find_discussion(discussion_id, params={}, headers=default_jwt_headers)
|
46
|
+
info("Finding the \"#{discussion_id}\" Discussion.")
|
47
|
+
get("#{@api_url}/discussions/#{discussion_id}", params, headers)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Update a Discussion
|
51
|
+
#
|
52
|
+
# @param discussion_id [String] id of the Discussion
|
53
|
+
# @param properties [Hash] form properties to update
|
54
|
+
# - +title+ [String]
|
55
|
+
# - +description+ [String]
|
56
|
+
# - +isArchived+ [Boolean]
|
57
|
+
# - +joinPolicy+ [String] name of the security policy that defines who can join
|
58
|
+
# - +owningUsers+ [Array] array of user usernames
|
59
|
+
# - +owningTeams+ [Array] array of team names
|
60
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication and accept JSON content type
|
61
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
62
|
+
def update_discussion(discussion_id, properties={}, headers=default_jwt_headers)
|
63
|
+
info("Updating the \"#{discussion_id}\" Discussion.")
|
64
|
+
put("#{@api_url}/discussions/#{discussion_id}", properties, headers)
|
65
|
+
end
|
66
|
+
|
67
|
+
# Export all discussion attachments
|
68
|
+
#
|
69
|
+
# This method streams the attachments in chunks to avoid consuming large
|
70
|
+
# amounts of memory.
|
71
|
+
#
|
72
|
+
# The message attachments will be saved to the
|
73
|
+
# `{export_directory}/{discussion_id}/files/{message_id}` directory, where:
|
74
|
+
#
|
75
|
+
# * +export_directory+: the directory specified in the SDK configuration
|
76
|
+
# * +discussion_id+: the id of the discussion
|
77
|
+
# * +message_id+: the id of the message that contains the attachment
|
78
|
+
#
|
79
|
+
# @param discussion_id [String] id of the discussion
|
80
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
81
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication
|
82
|
+
def export_discussion_attachments(discussion_id, params={}, headers=header_bearer_auth)
|
83
|
+
raise StandardError.new "An export directory must be defined to export a file attachment." if @options[:export_directory].nil?
|
84
|
+
info("Exporting all file attachments in the #{discussion_id} Discussion.")
|
85
|
+
info("This may take a while.")
|
86
|
+
# File Counter
|
87
|
+
counter = 0
|
88
|
+
# write the files
|
89
|
+
find_messages(discussion_id, params, headers).content['messages'].each do |m|
|
90
|
+
message_id = m['id']
|
91
|
+
updated_at = m['updatedAt']
|
92
|
+
m['content'].each do |item|
|
93
|
+
if (item['type'] == "attachment")
|
94
|
+
document_id = item['value']['documentId']
|
95
|
+
filename = item['value']['filename']
|
96
|
+
# count the files
|
97
|
+
counter = counter + 1
|
98
|
+
# export the file attachments
|
99
|
+
export_message_attachment(discussion_id, message_id, document_id, filename, params, headers)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
info("Exported #{counter} file attachments for the #{discussion_id} Discussion")
|
104
|
+
end
|
105
|
+
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
module KineticSdk
|
2
|
+
class Discussions
|
3
|
+
|
4
|
+
# Invite an email that doesn't have a user account
|
5
|
+
#
|
6
|
+
# @param discussion_id [String] id of the discussion
|
7
|
+
# @param email [String] email to invite
|
8
|
+
# @param message [String] message sent with the invitation
|
9
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication and accept JSON content type
|
10
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
11
|
+
def add_invitation_by_email(discussion_id, email, message=nil, headers=default_jwt_headers)
|
12
|
+
payload = { "email" => email }
|
13
|
+
payload["message"] = message unless message.nil?
|
14
|
+
info("Inviting #{email} to the #{discussion_id} Discussion")
|
15
|
+
post("#{@api_url}/discussions/#{discussion_id}/invitations", payload, headers)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Invite a user that already has an account
|
19
|
+
#
|
20
|
+
# @param discussion_id [String] id of the discussion
|
21
|
+
# @param username [String] username to invite
|
22
|
+
# @param message [String] message sent with the invitation
|
23
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication and accept JSON content type
|
24
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
25
|
+
def add_invitation_by_username(discussion_id, username, message=nil, headers=default_jwt_headers)
|
26
|
+
payload = { "user" => { "username" => username } }
|
27
|
+
payload["message"] = message unless message.nil?
|
28
|
+
info("Inviting #{username} to the #{discussion_id} Discussion")
|
29
|
+
post("#{@api_url}/discussions/#{discussion_id}/invitations", payload, headers)
|
30
|
+
end
|
31
|
+
|
32
|
+
# Delete an email invitation
|
33
|
+
#
|
34
|
+
# @param discussion_id [String] id of the discussion
|
35
|
+
# @param email [String] email the invitation was sent to
|
36
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication
|
37
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
38
|
+
def delete_invitation_by_email(discussion_id, email, headers=header_bearer_auth)
|
39
|
+
info("Deleting the email invitation to the #{discussion_id} Discussion for #{email}")
|
40
|
+
delete("#{@api_url}/discussions/#{discussion_id}/invitations/#{encode(email)}?email=true", headers)
|
41
|
+
end
|
42
|
+
|
43
|
+
# Delete a user invitation
|
44
|
+
#
|
45
|
+
# @param discussion_id [String] id of the discussion
|
46
|
+
# @param username [String] username the invitation was sent to
|
47
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication
|
48
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
49
|
+
def delete_invitation_by_username(discussion_id, username, headers=header_bearer_auth)
|
50
|
+
info("Deleting the user invitation to the #{discussion_id} Discussion for #{username}")
|
51
|
+
delete("#{@api_url}/discussions/#{discussion_id}/invitations/#{encode(username)}", headers)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Find invitations in a discussion
|
55
|
+
#
|
56
|
+
# @param discussion_id [String] id of the discussion
|
57
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
58
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication and accept JSON content type
|
59
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
60
|
+
def find_invitations(discussion_id, params={}, headers=default_jwt_headers)
|
61
|
+
info("Finding Invitations in the #{discussion_id} Discussion")
|
62
|
+
get("#{@api_url}/discussions/#{discussion_id}/invitations", params, headers)
|
63
|
+
end
|
64
|
+
|
65
|
+
# Find an invitation in a discussion by email
|
66
|
+
#
|
67
|
+
# @param discussion_id [String] id of the discussion
|
68
|
+
# @param email [String] email the invitation was sent to
|
69
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
70
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication and accept JSON content type
|
71
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
72
|
+
def find_invitation_by_email(discussion_id, email, params={}, headers=default_jwt_headers)
|
73
|
+
params['email'] = 'true' if params['email'].nil?
|
74
|
+
info("Finding the Invitation for email #{email} in the #{discussion_id} Discussion")
|
75
|
+
get("#{@api_url}/discussions/#{discussion_id}/invitations/#{encode(email)}", params, headers)
|
76
|
+
end
|
77
|
+
|
78
|
+
# Find an invitation in a discussion by username
|
79
|
+
#
|
80
|
+
# @param discussion_id [String] id of the discussion
|
81
|
+
# @param username [String] username of the invitation
|
82
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
83
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication and accept JSON content type
|
84
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
85
|
+
def find_invitation_by_username(discussion_id, username, params={}, headers=default_jwt_headers)
|
86
|
+
params.delete('email')
|
87
|
+
info("Finding the Invitation for user #{username} in the #{discussion_id} Discussion")
|
88
|
+
get("#{@api_url}/discussions/#{discussion_id}/invitations/#{encode(username)}", params, headers)
|
89
|
+
end
|
90
|
+
|
91
|
+
# Resend an email invitation
|
92
|
+
#
|
93
|
+
# @param discussion_id [String] id of the discussion
|
94
|
+
# @param email [String] email the invitation was sent to
|
95
|
+
# @param message [String] updated message to send with the invitation
|
96
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication and accept JSON content type
|
97
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
98
|
+
def resend_invitation_by_email(discussion_id, email, message, headers=default_jwt_headers)
|
99
|
+
payload = {}
|
100
|
+
payload["message"] = message unless message.nil?
|
101
|
+
info("Reinviting #{email} to the #{discussion_id} Discussion")
|
102
|
+
put("#{@api_url}/discussions/#{discussion_id}/invitations/#{encode(email)}?email=true", payload, headers)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Resend a user invitation
|
106
|
+
#
|
107
|
+
# @param discussion_id [String] id of the discussion
|
108
|
+
# @param username [String] username the invitation was sent to
|
109
|
+
# @param message [String] updated message to send with the invitation
|
110
|
+
# @param headers [Hash] hash of headers to send, default is bearer authentication and accept JSON content type
|
111
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
112
|
+
def resend_invitation_by_username(discussion_id, username, message, headers=default_jwt_headers)
|
113
|
+
payload = {}
|
114
|
+
payload["message"] = message unless message.nil?
|
115
|
+
info("Reinviting #{username} to the #{discussion_id} Discussion")
|
116
|
+
put("#{@api_url}/discussions/#{discussion_id}/invitations/#{encode(username)}", payload, headers)
|
117
|
+
end
|
118
|
+
|
119
|
+
end
|
120
|
+
end
|