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,153 @@
|
|
1
|
+
module KineticSdk
|
2
|
+
class RequestCe
|
3
|
+
|
4
|
+
# Add a new user 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_user_attribute_definition(name, description, allows_multiple, headers=default_headers)
|
12
|
+
body = {
|
13
|
+
"allowsMultiple" => allows_multiple,
|
14
|
+
"description" => description,
|
15
|
+
"name" => name
|
16
|
+
}
|
17
|
+
info("Adding User attribute definition \"#{name}\" to the \"#{space_slug}\" space.")
|
18
|
+
# Create the user attribute definition
|
19
|
+
post("#{@api_url}/userAttributeDefinitions", body, headers)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Add a new user profile attribute definition.
|
23
|
+
#
|
24
|
+
# @param name [String] name of the attribute definition
|
25
|
+
# @param description [String] description of the attribute definition
|
26
|
+
# @param allows_multiple [Boolean] whether the attribute allows multiple values
|
27
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
28
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
29
|
+
def add_user_profile_attribute_definition(name, description, allows_multiple, headers=default_headers)
|
30
|
+
body = {
|
31
|
+
"allowsMultiple" => allows_multiple,
|
32
|
+
"description" => description,
|
33
|
+
"name" => name
|
34
|
+
}
|
35
|
+
info("Adding User attribute definition \"#{name}\" to the \"#{space_slug}\" space.")
|
36
|
+
# Create the user attribute definition
|
37
|
+
post("#{@api_url}/userProfileAttributeDefinitions", body, headers)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Add a new space attribute definition.
|
41
|
+
#
|
42
|
+
# @param name [String] name of the attribute definition
|
43
|
+
# @param description [String] description of the attribute definition
|
44
|
+
# @param allows_multiple [Boolean] whether the attribute allows multiple values
|
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 add_space_attribute_definition(name, description, allows_multiple, headers=default_headers)
|
48
|
+
body = {
|
49
|
+
"allowsMultiple" => allows_multiple,
|
50
|
+
"description" => description,
|
51
|
+
"name" => name
|
52
|
+
}
|
53
|
+
info("Adding Space attribute definition \"#{name}\" to the \"#{space_slug}\" space.")
|
54
|
+
# Create the attribute definition
|
55
|
+
post("#{@api_url}/spaceAttributeDefinitions", body, headers)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Add a new datastore form attribute definition.
|
59
|
+
#
|
60
|
+
# @param name [String] name of the attribute definition
|
61
|
+
# @param description [String] description of the attribute definition
|
62
|
+
# @param allows_multiple [Boolean] whether the attribute allows multiple values
|
63
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
64
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
65
|
+
def add_datastore_form_attribute_definition(name, description, allows_multiple, headers=default_headers)
|
66
|
+
body = {
|
67
|
+
"allowsMultiple" => allows_multiple,
|
68
|
+
"description" => description,
|
69
|
+
"name" => name
|
70
|
+
}
|
71
|
+
info("Adding Datastore Form attribute definition \"#{name}\" to the \"#{space_slug}\" space.")
|
72
|
+
# Create the attribute definition
|
73
|
+
post("#{@api_url}/datastoreFormAttributeDefinitions", body, headers)
|
74
|
+
end
|
75
|
+
|
76
|
+
# Add a new category attribute definition.
|
77
|
+
#
|
78
|
+
# @param kapp_slug [String] slug of the kapp where the category exists
|
79
|
+
# @param name [String] name of the attribute definition
|
80
|
+
# @param description [String] description of the attribute definition
|
81
|
+
# @param allows_multiple [Boolean] whether the attribute allows multiple values
|
82
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
83
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
84
|
+
def add_category_attribute_definition(kapp_slug, name, description, allows_multiple, headers=default_headers)
|
85
|
+
body = {
|
86
|
+
"allowsMultiple" => allows_multiple,
|
87
|
+
"description" => description,
|
88
|
+
"name" => name
|
89
|
+
}
|
90
|
+
info("Adding Category attribute definition \"#{name}\" to the \"#{kapp_slug}\" kapp.")
|
91
|
+
# Create the attribute definition
|
92
|
+
post("#{@api_url}/kapps/#{kapp_slug}/categoryAttributeDefinitions", body, headers)
|
93
|
+
end
|
94
|
+
|
95
|
+
# Add a new form attribute definition.
|
96
|
+
#
|
97
|
+
# @param kapp_slug [String] slug of the kapp where the form exists
|
98
|
+
# @param name [String] name of the attribute definition
|
99
|
+
# @param description [String] description of the attribute definition
|
100
|
+
# @param allows_multiple [Boolean] whether the attribute allows multiple values
|
101
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
102
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
103
|
+
def add_form_attribute_definition(kapp_slug, name, description, allows_multiple, headers=default_headers)
|
104
|
+
body = {
|
105
|
+
"allowsMultiple" => allows_multiple,
|
106
|
+
"description" => description,
|
107
|
+
"name" => name
|
108
|
+
}
|
109
|
+
info("Adding Form attribute definition \"#{name}\" to the \"#{kapp_slug}\" kapp.")
|
110
|
+
# Create the attribute definition
|
111
|
+
post("#{@api_url}/kapps/#{kapp_slug}/formAttributeDefinitions", body, headers)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Add a new kapp attribute definition.
|
115
|
+
#
|
116
|
+
# @param kapp_slug [String] slug of the kapp
|
117
|
+
# @param name [String] name of the attribute definition
|
118
|
+
# @param description [String] description of the attribute definition
|
119
|
+
# @param allows_multiple [Boolean] whether the attribute allows multiple values
|
120
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
121
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
122
|
+
def add_kapp_attribute_definition(kapp_slug, name, description, allows_multiple, headers=default_headers)
|
123
|
+
body = {
|
124
|
+
"allowsMultiple" => allows_multiple,
|
125
|
+
"description" => description,
|
126
|
+
"name" => name
|
127
|
+
}
|
128
|
+
info("Adding Kapp attribute definition \"#{name}\" to the \"#{kapp_slug}\" kapp.")
|
129
|
+
# Create the attribute definition
|
130
|
+
post("#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions", body, headers)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Add a new team attribute definition.
|
134
|
+
#
|
135
|
+
# @param name [String] name of the attribute definition
|
136
|
+
# @param description [String] description of the attribute definition
|
137
|
+
# @param allows_multiple [Boolean] whether the attribute allows multiple values
|
138
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
139
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
140
|
+
def add_team_attribute_definition(name, description, allows_multiple, headers=default_headers)
|
141
|
+
body = {
|
142
|
+
"allowsMultiple" => allows_multiple,
|
143
|
+
"description" => description,
|
144
|
+
"name" => name
|
145
|
+
}
|
146
|
+
info("Adding Team attribute definition \"#{name}\" to the \"#{space_slug}\" space.")
|
147
|
+
# Create the team attribute definition
|
148
|
+
post("#{@api_url}/teamAttributeDefinitions", body, headers)
|
149
|
+
end
|
150
|
+
|
151
|
+
|
152
|
+
end
|
153
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module KineticSdk
|
2
|
+
class RequestCe
|
3
|
+
|
4
|
+
# Add a Bridge
|
5
|
+
#
|
6
|
+
# @param body [Hash] optional properties associated to the Bridge
|
7
|
+
# - +name+
|
8
|
+
# - +status+
|
9
|
+
# - +url+
|
10
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
11
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
12
|
+
def add_bridge(body={}, headers=default_headers)
|
13
|
+
info("Adding the \"#{body['name']}\" Bridge.")
|
14
|
+
post("#{@api_url}/bridges", body, headers)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Add a Bridge Model
|
18
|
+
#
|
19
|
+
# @param body [Hash] optional properties associated to the Bridge Model
|
20
|
+
# - +name+
|
21
|
+
# - +status+
|
22
|
+
# - +activeMappingName+
|
23
|
+
# - +attributes+
|
24
|
+
# - +mappings+
|
25
|
+
# - +qualifications+
|
26
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
27
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
28
|
+
def add_bridge_model(body={}, headers=default_headers)
|
29
|
+
info("Adding the \"#{body['name']}\" Bridge Model and Mappings.")
|
30
|
+
post("#{@api_url}/models", body, headers)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Find a list of bridges
|
34
|
+
#
|
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_bridges(params={}, headers=default_headers)
|
39
|
+
info("Find Bridges.")
|
40
|
+
get("#{@api_url}/bridges", params, headers)
|
41
|
+
end
|
42
|
+
|
43
|
+
# Find a bridge
|
44
|
+
#
|
45
|
+
# @param name [String] name of the bridge
|
46
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
47
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
48
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
49
|
+
def find_bridge(name, params={}, headers=default_headers)
|
50
|
+
info("Finding the \"#{name}\" Bridge.")
|
51
|
+
get("#{@api_url}/bridges/#{encode{name}}", params, headers)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Update a bridge
|
55
|
+
#
|
56
|
+
# @param name [String] name of the bridge
|
57
|
+
# @param body [Hash] properties of the bridge to update
|
58
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
59
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
60
|
+
def update_bridge(name, body={}, headers=default_headers)
|
61
|
+
info("Updating the \"#{name}\" Bridge.")
|
62
|
+
put("#{@api_url}/bridges/#{encode(name)}", body, headers)
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module KineticSdk
|
2
|
+
class RequestCe
|
3
|
+
|
4
|
+
# Add a category on a Kapp
|
5
|
+
#
|
6
|
+
# @param kapp_slug [String] slug of the Kapp the category belongs to
|
7
|
+
# @param body [Hash] category properties
|
8
|
+
# - +name+ - A descriptive name for the category
|
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_category_on_kapp(kapp_slug, body, headers=default_headers)
|
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")
|
14
|
+
post("#{@api_url}/kapps/#{kapp_slug}/categories", body, headers)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Add a categorization on a form
|
18
|
+
#
|
19
|
+
# @param kapp_slug [String] slug of the Kapp the category belongs to
|
20
|
+
# @param body [Hash] categorization properties
|
21
|
+
# - +category+ - A hash of properties for the category
|
22
|
+
# - +category/slug+ - The slug of the category to apply to the form
|
23
|
+
# - +form+ - A hash of properties for the form
|
24
|
+
# - +form/slug+ - The slug of the form to apply the category
|
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 add_categorization_on_form(kapp_slug, body, headers=default_headers)
|
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")
|
30
|
+
post("#{@api_url}/kapps/#{kapp_slug}/categorizations", body, headers)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
module KineticSdk
|
2
|
+
class RequestCe
|
3
|
+
|
4
|
+
# Add a Datastore Form
|
5
|
+
#
|
6
|
+
# @param form_properties [Hash] form properties
|
7
|
+
# - +customHeadContent+
|
8
|
+
# - +description+
|
9
|
+
# - +name+
|
10
|
+
# - +notes+
|
11
|
+
# - +slug+
|
12
|
+
# - +status+
|
13
|
+
# - +submissionLabelExpression+
|
14
|
+
# - +attributes+
|
15
|
+
# - +attributesMap+
|
16
|
+
# - +bridgedResources+
|
17
|
+
# - +pages+
|
18
|
+
# - +securityPolicies+
|
19
|
+
# - +indexDefinitions+
|
20
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
21
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
22
|
+
def add_datastore_form(form_properties={}, headers=default_headers)
|
23
|
+
info("Adding the \"#{form_properties['name']}\" Form.")
|
24
|
+
post("#{@api_url}/datastore/forms", form_properties, headers)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Delete a Datastore Form
|
28
|
+
#
|
29
|
+
# @param form_slug [String] slug of the form
|
30
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
31
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
32
|
+
def delete_datastore_form(form_slug, headers=default_headers)
|
33
|
+
info("Deleting the \"#{form_slug}\" Datastore Form")
|
34
|
+
delete("#{@api_url}/datastore/forms/#{form_slug}", headers)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Export a Datastore Form
|
38
|
+
#
|
39
|
+
# @param form_slug [String] slug of the form
|
40
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
41
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
42
|
+
def export_datastore_form(form_slug, headers=default_headers)
|
43
|
+
info("Exporting the \"#{form_slug}\" Datastore Form.")
|
44
|
+
get("#{@api_url}/datastore/forms/#{form_slug}", { 'export' => true }, headers)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Find Datastore Forms
|
48
|
+
#
|
49
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
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 find_datastore_forms(params={}, headers=default_headers)
|
53
|
+
info("Finding Forms.")
|
54
|
+
get("#{@api_url}/datastore/forms", params, headers)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Find a Datastore Form
|
58
|
+
#
|
59
|
+
# @param form_slug [String] slug of the form
|
60
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
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 find_datastore_form(form_slug, params={}, headers=default_headers)
|
64
|
+
info("Finding the \"#{form_slug}\" Datastore Form")
|
65
|
+
get("#{@api_url}/datastore/forms/#{form_slug}", params, headers)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Update a Datastore Form
|
69
|
+
#
|
70
|
+
# @param form_slug [String] slug of the form
|
71
|
+
# @param properties [Hash] form properties to update
|
72
|
+
# - +customHeadContent+
|
73
|
+
# - +description+
|
74
|
+
# - +name+
|
75
|
+
# - +notes+
|
76
|
+
# - +slug+
|
77
|
+
# - +status+
|
78
|
+
# - +submissionLabelExpression+
|
79
|
+
# - +attributes+
|
80
|
+
# - +attributesMap+
|
81
|
+
# - +bridgedResources+
|
82
|
+
# - +pages+
|
83
|
+
# - +securityPolicies+
|
84
|
+
# - +indexDefinitions+
|
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 update_datastore_form(form_slug, properties={}, headers=default_headers)
|
88
|
+
info("Updating the \"#{form_slug}\" Datastore Form.")
|
89
|
+
put("#{@api_url}/datastore/forms/#{form_slug}", properties, headers)
|
90
|
+
end
|
91
|
+
|
92
|
+
# Build Datastore Indexes
|
93
|
+
#
|
94
|
+
# @param form_slug [String] slug of the form
|
95
|
+
# @param indexes [Array] array of index names to build indexes
|
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 build_datastore_form_indexes(form_slug, indexes, headers=default_headers)
|
99
|
+
payload = {
|
100
|
+
"type" => "Datastore Indexing",
|
101
|
+
"content" => {
|
102
|
+
"indexes" => indexes
|
103
|
+
}
|
104
|
+
}
|
105
|
+
info("Building indexes for the \"#{form_slug}\" Datastore Form.")
|
106
|
+
post("#{@api_url}/datastore/forms/#{form_slug}/backgroundJobs", payload, headers)
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,157 @@
|
|
1
|
+
module KineticSdk
|
2
|
+
class RequestCe
|
3
|
+
|
4
|
+
# Add a Datastore Submission
|
5
|
+
#
|
6
|
+
# @param form_slug [String] slug of the Form
|
7
|
+
# @param payload [Hash] payload of the submission
|
8
|
+
# - +origin+ - Origin ID of the submission to be added
|
9
|
+
# - +parent+ - Parent ID of the submission to be added
|
10
|
+
# - +values+ - hash of field values for the submission
|
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_datastore_submission(form_slug, payload={}, headers=default_headers)
|
14
|
+
# initialize "values" if nil
|
15
|
+
payload["values"] = {} if payload["values"].nil?
|
16
|
+
# set origin hash if origin was passed as a string
|
17
|
+
payload["origin"] = { "id" => payload["origin"] } if payload["origin"].is_a? String
|
18
|
+
# set parent hash if parent was passed as a string
|
19
|
+
payload["parent"] = { "id" => payload["parent"] } if payload["parent"].is_a? String
|
20
|
+
# Create the submission
|
21
|
+
info("Adding a submission in the \"#{form_slug}\" Datastore Form.")
|
22
|
+
post("#{@api_url}/datastore/forms/#{form_slug}/submissions", payload, headers)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Add a Datastore Submission page
|
26
|
+
#
|
27
|
+
# @param form_slug [String] slug of the Form
|
28
|
+
# @param page_name [String] name of the Page
|
29
|
+
# @param payload [Hash] payload of the submission
|
30
|
+
# - +origin+ - Origin ID of the submission to be added
|
31
|
+
# - +parent+ - Parent ID of the submission to be added
|
32
|
+
# - +values+ - hash of field values for the submission
|
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 add_datastore_submission_page(form_slug, page_name, payload={}, headers=default_headers)
|
36
|
+
# initialize "values" if nil
|
37
|
+
payload["values"] = {} if payload["values"].nil?
|
38
|
+
# set origin hash if origin was passed as a string
|
39
|
+
payload["origin"] = { "id" => payload["origin"] } if payload["origin"].is_a? String
|
40
|
+
# set parent hash if parent was passed as a string
|
41
|
+
payload["parent"] = { "id" => payload["parent"] } if payload["parent"].is_a? String
|
42
|
+
# Create the submission
|
43
|
+
info("Adding a submission page in the \"#{form_slug}\" Datastore Form.")
|
44
|
+
post("#{@api_url}/datastore/forms/#{form_slug}/submissions?page=#{encode(page_name)}", payload, headers)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Patch a new Datastore Submission
|
48
|
+
#
|
49
|
+
# @param form_slug [String] slug of the Form
|
50
|
+
# @param payload [Hash] payload of the submission
|
51
|
+
# - +origin+ - Origin ID of the submission to be patched
|
52
|
+
# - +parent+ - Parent ID of the submission to be patched
|
53
|
+
# - +values+ - hash of field values for the submission
|
54
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
55
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
56
|
+
def patch_datastore_submission(form_slug, payload={}, headers=default_headers)
|
57
|
+
# set the currentPage hash if currentPage was passed as a string
|
58
|
+
payload["currentPage"] = { "name" => payload["currentPage"] } if payload["currentPage"].is_a? String
|
59
|
+
# initialize "values" if nil
|
60
|
+
payload["values"] = {} if payload["values"].nil?
|
61
|
+
# set origin hash if origin was passed as a string
|
62
|
+
payload["origin"] = { "id" => payload["origin"] } if payload["origin"].is_a? String
|
63
|
+
# set parent hash if parent was passed as a string
|
64
|
+
payload["parent"] = { "id" => payload["parent"] } if payload["parent"].is_a? String
|
65
|
+
# Create the submission
|
66
|
+
info("Patching a submission in the \"#{form_slug}\" Form.")
|
67
|
+
patch("#{@api_url}/datastore/forms/#{form_slug}/submissions", payload, headers)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Find all Submissions for a Datastore Form.
|
71
|
+
#
|
72
|
+
# This method will process pages of form submissions and internally
|
73
|
+
# concatenate the results into a single array.
|
74
|
+
#
|
75
|
+
# Warning - using this method can cause out of memory errors on large
|
76
|
+
# result sets.
|
77
|
+
#
|
78
|
+
# @param form_slug [String] slug of the Form
|
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 find_all_form_datastore_submissions(form_slug, params={}, headers=default_headers)
|
83
|
+
info("Finding submissions for the \"#{form_slug}\" Datastore Form.")
|
84
|
+
# Make the initial request of pages submissions
|
85
|
+
response = find_form_datastore_submissions(form_slug, params, headers)
|
86
|
+
# Build the Messages Array
|
87
|
+
messages = response.content["messages"]
|
88
|
+
# Build Submissions Array
|
89
|
+
submissions = response.content["submissions"]
|
90
|
+
# if a next page token exists, keep retrieving submissions and add them to the results
|
91
|
+
while (!response.content["nextPageToken"].nil?)
|
92
|
+
params['pageToken'] = response.content["nextPageToken"]
|
93
|
+
response = find_form_datastore_submissions(form_slug, params, headers)
|
94
|
+
# concat the messages
|
95
|
+
messages.concat(response.content["messages"] || [])
|
96
|
+
# concat the submissions
|
97
|
+
submissions.concat(response.content["submissions"] || [])
|
98
|
+
end
|
99
|
+
final_content = { "messages" => messages, "submissions" => submissions, "nextPageToken" => nil }
|
100
|
+
# Return the results
|
101
|
+
response.content=final_content
|
102
|
+
response.content_string=final_content.to_json
|
103
|
+
response
|
104
|
+
end
|
105
|
+
|
106
|
+
# Find a page of Submissions for a Datastore form.
|
107
|
+
#
|
108
|
+
# The page offset can be defined by passing in the "pageToken" parameter,
|
109
|
+
# indicating the value of the token that will represent the first
|
110
|
+
# submission in the result set. If not provided, the first page of
|
111
|
+
# submissions will be retrieved.
|
112
|
+
#
|
113
|
+
# @param form_slug [String] slug of the Form
|
114
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
115
|
+
# - +pageToken+ - used for paginated results
|
116
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
117
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
118
|
+
def find_form_datastore_submissions(form_slug, params={}, headers=default_headers)
|
119
|
+
# Get next page token
|
120
|
+
token = params["pageToken"]
|
121
|
+
if token.nil?
|
122
|
+
info("Finding first page of submissions for the \"#{form_slug}\" Datastore.")
|
123
|
+
else
|
124
|
+
info("Finding page of submissions starting with token \"#{token}\" for the \"#{form_slug}\" Form.")
|
125
|
+
end
|
126
|
+
|
127
|
+
# Build Submission URL
|
128
|
+
url = "#{@api_url}/datastore/forms/#{form_slug}/submissions"
|
129
|
+
# Return the response
|
130
|
+
get(url, params, headers)
|
131
|
+
end
|
132
|
+
|
133
|
+
|
134
|
+
# Update a Datastore submission
|
135
|
+
#
|
136
|
+
# @param submission_id [String] String value of the Submission Id (UUID)
|
137
|
+
# @param body [Hash] submission properties to update
|
138
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
139
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
140
|
+
def update_datastore_submission(submission_id, body={}, headers=default_headers)
|
141
|
+
info("Updating Datastore Submission \"#{submission_id}\"")
|
142
|
+
put("#{@api_url}/datastore/submissions/#{encode(submission_id)}", body, headers)
|
143
|
+
end
|
144
|
+
|
145
|
+
|
146
|
+
# Delete a Datastore submission
|
147
|
+
#
|
148
|
+
# @param submission_id [String] String value of the Submission Id (UUID)
|
149
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
150
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
151
|
+
def delete_datastore_submission(submission_id, headers=default_headers)
|
152
|
+
info("Deleting Datastore Submission \"#{submission_id}\"")
|
153
|
+
delete("#{@api_url}/datastore/submissions/#{encode(submission_id)}", headers)
|
154
|
+
end
|
155
|
+
|
156
|
+
end
|
157
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
module KineticSdk
|
2
|
+
class RequestCe
|
3
|
+
|
4
|
+
# Add a Form
|
5
|
+
#
|
6
|
+
# @param kapp_slug [String] slug of the Kapp the form belongs to
|
7
|
+
# @param form_properties [Hash] form properties
|
8
|
+
# - +anonymous+
|
9
|
+
# - +customHeadContent+
|
10
|
+
# - +description+
|
11
|
+
# - +name+
|
12
|
+
# - +notes+
|
13
|
+
# - +slug+
|
14
|
+
# - +status+
|
15
|
+
# - +submissionLabelExpression+
|
16
|
+
# - +type+
|
17
|
+
# - +attributes+
|
18
|
+
# - +bridgedResources+
|
19
|
+
# - +pages+
|
20
|
+
# - +securityPolicies+
|
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 add_form(kapp_slug, form_properties={}, headers=default_headers)
|
24
|
+
info("Adding the \"#{form_properties['name']}\" Form.")
|
25
|
+
post("#{@api_url}/kapps/#{kapp_slug}/forms", form_properties, headers)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Delete a Form
|
29
|
+
#
|
30
|
+
# @param kapp_slug [String] slug of the Kapp the form belongs to
|
31
|
+
# @param form_slug [String] slug of the form
|
32
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
33
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
34
|
+
def delete_form(kapp_slug, form_slug, headers=default_headers)
|
35
|
+
info("Deleting the \"#{form_slug}\" Form in the \"#{kapp_slug}\" Kapp.")
|
36
|
+
delete("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}", headers)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Export a Form
|
40
|
+
#
|
41
|
+
# @param kapp_slug [String] slug of the Kapp the form belongs to
|
42
|
+
# @param form_slug [String] slug of the form
|
43
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
44
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
45
|
+
def export_form(kapp_slug, form_slug, headers=default_headers)
|
46
|
+
info("Exporting the \"#{form_slug}\" Form in the \"#{kapp_slug}\" Kapp.")
|
47
|
+
get("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}", { 'export' => true }, headers)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Find Forms
|
51
|
+
#
|
52
|
+
# @param kapp_slug [String] slug of the Kapp the forms belongs to
|
53
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
54
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
55
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
56
|
+
def find_forms(kapp_slug, params={}, headers=default_headers)
|
57
|
+
info("Finding Forms.")
|
58
|
+
get("#{@api_url}/kapps/#{kapp_slug}/forms", params, headers)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Find a Form
|
62
|
+
#
|
63
|
+
# @param kapp_slug [String] slug of the Kapp the form belongs to
|
64
|
+
# @param form_slug [String] slug of the form
|
65
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
66
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
67
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
68
|
+
def find_form(kapp_slug, form_slug, params={}, headers=default_headers)
|
69
|
+
info("Finding the \"#{form_slug}\" Form in the \"#{kapp_slug}\" Kapp.")
|
70
|
+
get("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}", params, headers)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Update a Form
|
74
|
+
#
|
75
|
+
# @param kapp_slug [String] slug of the Kapp the form belongs to
|
76
|
+
# @param form_slug [String] slug of the form
|
77
|
+
# @param properties [Hash] form properties to update
|
78
|
+
# - +anonymous+
|
79
|
+
# - +customHeadContent+
|
80
|
+
# - +description+
|
81
|
+
# - +name+
|
82
|
+
# - +notes+
|
83
|
+
# - +slug+
|
84
|
+
# - +status+
|
85
|
+
# - +submissionLabelExpression+
|
86
|
+
# - +type+
|
87
|
+
# - +attributes+
|
88
|
+
# - +bridgedResources+
|
89
|
+
# - +pages+
|
90
|
+
# - +securityPolicies+
|
91
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
92
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
93
|
+
def update_form(kapp_slug, form_slug, properties={}, headers=default_headers)
|
94
|
+
info("Updating the \"#{form_slug}\" Form in the \"#{kapp_slug}\" Kapp.")
|
95
|
+
put("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}", properties, headers)
|
96
|
+
end
|
97
|
+
|
98
|
+
end
|
99
|
+
end
|