voog_api 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +3 -0
  5. data/Guardfile +5 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.markdown +55 -0
  8. data/Rakefile +1 -0
  9. data/lib/voog_api/api/articles.rb +77 -0
  10. data/lib/voog_api/api/assets.rb +31 -0
  11. data/lib/voog_api/api/comments.rb +36 -0
  12. data/lib/voog_api/api/content_partials.rb +21 -0
  13. data/lib/voog_api/api/contents.rb +38 -0
  14. data/lib/voog_api/api/element_definitions.rb +31 -0
  15. data/lib/voog_api/api/elements.rb +63 -0
  16. data/lib/voog_api/api/forms.rb +21 -0
  17. data/lib/voog_api/api/languages.rb +68 -0
  18. data/lib/voog_api/api/layout_assets.rb +39 -0
  19. data/lib/voog_api/api/layouts.rb +31 -0
  20. data/lib/voog_api/api/media_sets.rb +36 -0
  21. data/lib/voog_api/api/nodes.rb +26 -0
  22. data/lib/voog_api/api/pages.rb +77 -0
  23. data/lib/voog_api/api/people.rb +16 -0
  24. data/lib/voog_api/api/site.rb +35 -0
  25. data/lib/voog_api/api/tags.rb +26 -0
  26. data/lib/voog_api/api/texts.rb +21 -0
  27. data/lib/voog_api/api/tickets.rb +26 -0
  28. data/lib/voog_api/client.rb +140 -0
  29. data/lib/voog_api/version.rb +3 -0
  30. data/lib/voog_api.rb +46 -0
  31. data/spec/fixtures/articles/article.json +37 -0
  32. data/spec/fixtures/articles/articles.json +75 -0
  33. data/spec/fixtures/assets/asset.json +24 -0
  34. data/spec/fixtures/assets/assets.json +29 -0
  35. data/spec/fixtures/comments/comment.json +21 -0
  36. data/spec/fixtures/comments/comments.json +35 -0
  37. data/spec/fixtures/content_partials/content_partial.json +27 -0
  38. data/spec/fixtures/content_partials/content_partials.json +47 -0
  39. data/spec/fixtures/contents/content.json +31 -0
  40. data/spec/fixtures/contents/contents.json +63 -0
  41. data/spec/fixtures/element_definitions/element_definition.json +31 -0
  42. data/spec/fixtures/element_definitions/element_definitions.json +15 -0
  43. data/spec/fixtures/elements/element.json +35 -0
  44. data/spec/fixtures/elements/elements.json +57 -0
  45. data/spec/fixtures/forms/form.json +104 -0
  46. data/spec/fixtures/forms/forms.json +43 -0
  47. data/spec/fixtures/languages/language.json +13 -0
  48. data/spec/fixtures/languages/languages.json +27 -0
  49. data/spec/fixtures/layout_assets/layout_asset.json +14 -0
  50. data/spec/fixtures/layout_assets/layout_assets.json +29 -0
  51. data/spec/fixtures/layouts/layout.json +11 -0
  52. data/spec/fixtures/layouts/layouts.json +23 -0
  53. data/spec/fixtures/media_sets/media_set.json +23 -0
  54. data/spec/fixtures/media_sets/media_sets.json +32 -0
  55. data/spec/fixtures/nodes/node.json +11 -0
  56. data/spec/fixtures/nodes/nodes.json +23 -0
  57. data/spec/fixtures/pages/page.json +73 -0
  58. data/spec/fixtures/pages/pages.json +104 -0
  59. data/spec/fixtures/people/people.json +29 -0
  60. data/spec/fixtures/people/person.json +14 -0
  61. data/spec/fixtures/site/site.json +30 -0
  62. data/spec/fixtures/tags/tag.json +20 -0
  63. data/spec/fixtures/tags/tags.json +31 -0
  64. data/spec/fixtures/texts/text.json +23 -0
  65. data/spec/fixtures/texts/texts.json +45 -0
  66. data/spec/fixtures/tickets/ticket.json +26 -0
  67. data/spec/fixtures/tickets/tickets.json +29 -0
  68. data/spec/spec_helper.rb +46 -0
  69. data/spec/voog_api/api/articles_spec.rb +89 -0
  70. data/spec/voog_api/api/assets_spec.rb +53 -0
  71. data/spec/voog_api/api/comments_spec.rb +66 -0
  72. data/spec/voog_api/api/content_partials_spec.rb +41 -0
  73. data/spec/voog_api/api/contents_spec.rb +53 -0
  74. data/spec/voog_api/api/element_definitions_spec.rb +53 -0
  75. data/spec/voog_api/api/elements_spec.rb +78 -0
  76. data/spec/voog_api/api/forms_spec.rb +41 -0
  77. data/spec/voog_api/api/languages_spec.rb +89 -0
  78. data/spec/voog_api/api/layout_assets_spec.rb +54 -0
  79. data/spec/voog_api/api/layouts_spec.rb +53 -0
  80. data/spec/voog_api/api/media_sets_spec.rb +64 -0
  81. data/spec/voog_api/api/nodes_spec.rb +52 -0
  82. data/spec/voog_api/api/pages_spec.rb +89 -0
  83. data/spec/voog_api/api/people_spec.rb +30 -0
  84. data/spec/voog_api/api/site_spec.rb +53 -0
  85. data/spec/voog_api/api/tags_spec.rb +53 -0
  86. data/spec/voog_api/api/texts_spec.rb +41 -0
  87. data/spec/voog_api/api/tickets_spec.rb +54 -0
  88. data/spec/voog_spec.rb +38 -0
  89. data/voog_api.gemspec +27 -0
  90. metadata +278 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4e20e5667103808724ed2df2060430cb06585194
4
+ data.tar.gz: 87276171f2c2ad169c6241aac2a53e9d3e35a00c
5
+ SHA512:
6
+ metadata.gz: 85efc4a527b459c8787b6639dafc1552ea640ed3af02fc2e4568f28b729d0607e4e4ba3ab4e1877251853f3ff6af40354abb31b5e817d18cf37499a14d9fde6a
7
+ data.tar.gz: d0cf82aad10c84fcf89cd169a01e78263242adb8588771faaef74f3be4e449b9a78d96fd6895b317016a58964e109bf7af251c9b1b02f8de5ee2a69f6ab1f325
data/.gitignore ADDED
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .ruby-version
19
+ .ruby-gemset
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+ gem 'rest-client'
3
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,5 @@
1
+ guard :rspec do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
+ watch('spec/helper.rb') { "spec" }
5
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Priit Haamer
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown ADDED
@@ -0,0 +1,55 @@
1
+ # voog.rb
2
+
3
+ Ruby toolkit for the [Voog](http://www.voog.com) API.
4
+
5
+ Learn more at the [Voog developer central](http://www.voog.com/developers/api) and by reading the [Voog API documentation](http://www.voog.com/developers/api).
6
+
7
+ ## Getting started
8
+
9
+ Either add this line to your application's `Gemfile`:
10
+
11
+ ```
12
+ gem 'voog_api'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ ```
18
+ $ bundle
19
+ ```
20
+
21
+ Or install it yourself as:
22
+
23
+ ```
24
+ $ gem install voog_api
25
+ ```
26
+
27
+ ## API token
28
+
29
+ To generate your personal **API token** for your site, go to `Account` -> `My profile` and click on "Generate new API token".
30
+
31
+ ## Initializing the client
32
+
33
+ All requests to the Voog API are done through the `Voog::Client` class, which takes two parameters: site host and API token.
34
+
35
+ ```ruby
36
+ client = Voog::Client.new('example.com', 'afcf30182aecfc8155d390d7d4552d14')
37
+ ```
38
+
39
+ Making an API request is as simple as calling a single method on the client:
40
+
41
+ ```ruby
42
+ client.layouts
43
+ ```
44
+
45
+ Most responses from the client are `Response` objects that provide access to the API resource objects by using both dot and hash notation:
46
+
47
+ ```ruby
48
+ layout = client.layout(1)
49
+
50
+ puts layout.title
51
+ # => "Front page"
52
+
53
+ puts layout[:title]
54
+ # => "Front page"
55
+ ```
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,77 @@
1
+ module Voog
2
+ class API
3
+ module Articles
4
+
5
+ # List articles
6
+ def articles(params = {})
7
+ get 'articles', {query: params}
8
+ end
9
+
10
+ # Get a single article
11
+ def article(id, params = {})
12
+ get "articles/#{id}", {query: params}
13
+ end
14
+
15
+ # Create a article
16
+ def create_article(data)
17
+ post 'articles', data
18
+ end
19
+
20
+ # Update a article
21
+ def update_article(id, data)
22
+ put "articles/#{id}", data
23
+ end
24
+
25
+ # Patch a article
26
+ def patch_article(id, data)
27
+ patch "articles/#{id}", data
28
+ end
29
+
30
+ # Delete a article
31
+ def delete_article(id)
32
+ delete "articles/#{id}"
33
+ end
34
+
35
+ # Update/create a key in article data field
36
+ #
37
+ # @params id [String] key in data field
38
+ def update_article_data(article_id, id, data)
39
+ put "articles/#{article_id}/data/#{id}", {value: data}
40
+ end
41
+
42
+ # Delete a key from article data field
43
+ #
44
+ # @params id [String] key in data field
45
+ def delete_article_data(article_id, id)
46
+ delete "articles/#{article_id}/data/#{id}"
47
+ end
48
+
49
+ # Article contents
50
+
51
+ # List contents for article
52
+ def article_contents(id, params = {})
53
+ contents(Voog::API::Contents::ParentKind::Article, id, params)
54
+ end
55
+
56
+ # Get a single content for article
57
+ def article_content(article_id, id, params = {})
58
+ content(Voog::API::Contents::ParentKind::Article, article_id, id, params)
59
+ end
60
+
61
+ # Create a article content for article
62
+ def create_article_content(article_id, data)
63
+ create_content(Voog::API::Contents::ParentKind::Article, article_id, data)
64
+ end
65
+
66
+ # Delete a content from article
67
+ def delete_article_content(article_id, id)
68
+ delete_content(Voog::API::Contents::ParentKind::Article, article_id, id)
69
+ end
70
+
71
+ # Reorder/move article content inside/between content areas and parent objects
72
+ def move_article_content(article_id, id, params = {})
73
+ move_content(Voog::API::Contents::ParentKind::Article, article_id, id, params)
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,31 @@
1
+ module Voog
2
+ class API
3
+ module Assets
4
+
5
+ # List assets
6
+ def assets(params = {})
7
+ get 'assets', {query: params}
8
+ end
9
+
10
+ # Get a single asset
11
+ def asset(id, params = {})
12
+ get "assets/#{id}", {query: params}
13
+ end
14
+
15
+ # Create a asset
16
+ def create_asset(data)
17
+ post 'assets', data
18
+ end
19
+
20
+ # Confirm a asset upload
21
+ def confirm_asset(id)
22
+ put "assets/#{id}/confirm", nil
23
+ end
24
+
25
+ # Delete a asset
26
+ def delete_asset(id)
27
+ delete "assets/#{id}"
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,36 @@
1
+ module Voog
2
+ class API
3
+ module Comments
4
+
5
+ # List article comments
6
+ def comments(article_id, params = {})
7
+ get "articles/#{article_id}/comments", {query: params}
8
+ end
9
+
10
+ # Get a single comment for article
11
+ def comment(article_id, id, params = {})
12
+ get "articles/#{article_id}/comments/#{id}", {query: params}
13
+ end
14
+
15
+ # Create a comment
16
+ def create_comment(article_id, data)
17
+ post "articles/#{article_id}/comments", data
18
+ end
19
+
20
+ # Toggle comment spam flag
21
+ def toggle_spam_comment(article_id, id)
22
+ put "articles/#{article_id}/comments/#{id}/toggle_spam", nil
23
+ end
24
+
25
+ # Delete a article comment
26
+ def delete_comment(article_id, id)
27
+ delete "articles/#{article_id}/comments/#{id}"
28
+ end
29
+
30
+ # Delete all spam comment for article
31
+ def delete_spam_comments(article_id)
32
+ delete "articles/#{article_id}/comments/delete_spam"
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,21 @@
1
+ module Voog
2
+ class API
3
+ module ContentPartials
4
+
5
+ # List content partials contents
6
+ def content_partials(params = {})
7
+ get 'content_partials', {query: params}
8
+ end
9
+
10
+ # Get a single content partial content
11
+ def content_partial(id, params = {})
12
+ get "content_partials/#{id}", {query: params}
13
+ end
14
+
15
+ # Update a content partial content
16
+ def update_content_partial(id, data)
17
+ put "content_partials/#{id}", data
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,38 @@
1
+ module Voog
2
+ class API
3
+ module Contents
4
+
5
+ module ParentKind
6
+ Article = 'articles'
7
+ Element = 'elements'
8
+ Language = 'languages'
9
+ Page = 'pages'
10
+ end
11
+
12
+ # List contents
13
+ def contents(parent_name, parent_id, params = {})
14
+ get "#{parent_name}/#{parent_id}/contents", {query: params}
15
+ end
16
+
17
+ # Get a single content
18
+ def content(parent_name, parent_id, id, params = {})
19
+ get "#{parent_name}/#{parent_id}/contents/#{id}", {query: params}
20
+ end
21
+
22
+ # Create a content
23
+ def create_content(parent_name, parent_id, data)
24
+ post "#{parent_name}/#{parent_id}/contents", data
25
+ end
26
+
27
+ # Delete a content
28
+ def delete_content(parent_name, parent_id, id)
29
+ delete "#{parent_name}/#{parent_id}/contents/#{id}"
30
+ end
31
+
32
+ # Reorder/move content inside/between content areas and parent objects
33
+ def move_content(parent_name, parent_id, id, params = {})
34
+ put "#{parent_name}/#{parent_id}/contents/#{id}/move", nil, {query: params}
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,31 @@
1
+ module Voog
2
+ class API
3
+ module ElementDefinitions
4
+
5
+ # List element_definitions
6
+ def element_definitions(params = {})
7
+ get 'element_definitions', {query: params}
8
+ end
9
+
10
+ # Get a single element_definition
11
+ def element_definition(id, params = {})
12
+ get "element_definitions/#{id}", {query: params}
13
+ end
14
+
15
+ # Create a element_definition
16
+ def create_element_definition(data)
17
+ post 'element_definitions', data
18
+ end
19
+
20
+ # Update a element_definition
21
+ def update_element_definition(id, data)
22
+ put "element_definitions/#{id}", data
23
+ end
24
+
25
+ # Delete a element_definition
26
+ def delete_element_definition(id)
27
+ delete "element_definitions/#{id}"
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,63 @@
1
+ module Voog
2
+ class API
3
+ module Elements
4
+
5
+ # List elements
6
+ def elements(params = {})
7
+ get 'elements', {query: params}
8
+ end
9
+
10
+ # Get a single element
11
+ def element(id, params = {})
12
+ get "elements/#{id}", {query: params}
13
+ end
14
+
15
+ # Create a element
16
+ def create_element(data)
17
+ post 'elements', data
18
+ end
19
+
20
+ # Update a element
21
+ def update_element(id, data)
22
+ put "elements/#{id}", data
23
+ end
24
+
25
+ # Delete a element
26
+ def delete_element(id)
27
+ delete "elements/#{id}"
28
+ end
29
+
30
+ # Reorder a elements
31
+ def move_element(element_id, params)
32
+ put "elements/#{element_id}/move", nil, {query: params}
33
+ end
34
+
35
+ # Element contents
36
+
37
+ # List contents for element
38
+ def element_contents(id, params = {})
39
+ contents(Voog::API::Contents::ParentKind::Element, id, params)
40
+ end
41
+
42
+ # Get a single content for element
43
+ def element_content(element_id, id, params = {})
44
+ content(Voog::API::Contents::ParentKind::Element, element_id, id, params)
45
+ end
46
+
47
+ # Create a element content for element
48
+ def create_element_content(element_id, data)
49
+ create_content(Voog::API::Contents::ParentKind::Element, element_id, data)
50
+ end
51
+
52
+ # Delete a content from element
53
+ def delete_element_content(element_id, id)
54
+ delete_content(Voog::API::Contents::ParentKind::Element, element_id, id)
55
+ end
56
+
57
+ # Reorder/move element content inside/between content areas and parent objects
58
+ def move_element_content(element_id, id, params = {})
59
+ move_content(Voog::API::Contents::ParentKind::Element, element_id, id, params)
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,21 @@
1
+ module Voog
2
+ class API
3
+ module Forms
4
+
5
+ # List forms
6
+ def forms(params = {})
7
+ get 'forms', {query: params}
8
+ end
9
+
10
+ # Get a single form
11
+ def form(id, params = {})
12
+ get "forms/#{id}", {query: params}
13
+ end
14
+
15
+ # Update a form
16
+ def update_form(id, data)
17
+ put "forms/#{id}", data
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,68 @@
1
+ module Voog
2
+ class API
3
+ module Languages
4
+
5
+ # List languages
6
+ def languages(params = {})
7
+ get 'languages', {query: params}
8
+ end
9
+
10
+ # Get a single language
11
+ def language(id, params = {})
12
+ get "languages/#{id}", {query: params}
13
+ end
14
+
15
+ # Create a language
16
+ def create_language(data)
17
+ post 'languages', data
18
+ end
19
+
20
+ # Update a language
21
+ def update_language(id, data)
22
+ put "languages/#{id}", data
23
+ end
24
+
25
+ # Delete a language
26
+ def delete_language(id)
27
+ delete "languages/#{id}"
28
+ end
29
+
30
+ # Reorder a language
31
+ def move_language(language_id, params)
32
+ put "languages/#{language_id}/move", nil, {query: params}
33
+ end
34
+
35
+ # Enable language automatic detection for site visitors
36
+ def enable_language_autodetect
37
+ put "languages/enable_autodetect", nil
38
+ end
39
+
40
+ # Language contents
41
+
42
+ # List contents for language
43
+ def language_contents(id, params = {})
44
+ contents(Voog::API::Contents::ParentKind::Language, id, params)
45
+ end
46
+
47
+ # Get a single content for language
48
+ def language_content(language_id, id, params = {})
49
+ content(Voog::API::Contents::ParentKind::Language, language_id, id, params)
50
+ end
51
+
52
+ # Create a language content for language
53
+ def create_language_content(language_id, data)
54
+ create_content(Voog::API::Contents::ParentKind::Language, language_id, data)
55
+ end
56
+
57
+ # Delete a content from language
58
+ def delete_language_content(language_id, id)
59
+ delete_content(Voog::API::Contents::ParentKind::Language, language_id, id)
60
+ end
61
+
62
+ # Reorder/move language content inside/between content areas and parent objects
63
+ def move_language_content(language_id, id, params = {})
64
+ move_content(Voog::API::Contents::ParentKind::Language, language_id, id, params)
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,39 @@
1
+ module Voog
2
+ class API
3
+ module LayoutAssets
4
+
5
+ # List layouts assets
6
+ def layout_assets(params = {})
7
+ get 'layout_assets', {query: params}
8
+ end
9
+
10
+ # Get a single layout asset
11
+ def layout_asset(id, params = {})
12
+ get "layout_assets/#{id}", {query: params}
13
+ end
14
+
15
+ # Create a layout asset
16
+ def create_layout_asset(data)
17
+ if data && data.key?(:file)
18
+ data[:file] = Faraday::UploadIO.new(data[:file], data[:content_type])
19
+ options = {multipart: true}
20
+ end
21
+
22
+ post 'layout_assets', data, (options || {})
23
+ end
24
+
25
+ # Update a layout asset
26
+ def update_layout_asset(id, data)
27
+ if data && data.key?(:file)
28
+ data[:data] = File.read data.delete(:file)
29
+ end
30
+ put "layout_assets/#{id}", data
31
+ end
32
+
33
+ # Delete a layout asset
34
+ def delete_layout_asset(id)
35
+ delete "layout_assets/#{id}"
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,31 @@
1
+ module Voog
2
+ class API
3
+ module Layouts
4
+
5
+ # List layouts
6
+ def layouts(params = {})
7
+ get 'layouts', {query: params}
8
+ end
9
+
10
+ # Get a single layout
11
+ def layout(id, params = {})
12
+ get "layouts/#{id}", {query: params}
13
+ end
14
+
15
+ # Create a layout
16
+ def create_layout(data)
17
+ post 'layouts', data
18
+ end
19
+
20
+ # Update a layout
21
+ def update_layout(id, data)
22
+ put "layouts/#{id}", data
23
+ end
24
+
25
+ # Delete a layout
26
+ def delete_layout(id)
27
+ delete "layouts/#{id}"
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,36 @@
1
+ module Voog
2
+ class API
3
+ module MediaSets
4
+
5
+ # List media_sets
6
+ def media_sets(params = {})
7
+ get 'media_sets', {query: params}
8
+ end
9
+
10
+ # Get a single media_set
11
+ def media_set(id, params = {})
12
+ get "media_sets/#{id}", {query: params}
13
+ end
14
+
15
+ # Create a media_set
16
+ def create_media_set(data)
17
+ post 'media_sets', data
18
+ end
19
+
20
+ # Update a media_set
21
+ def update_media_set(id, data)
22
+ put "media_sets/#{id}", data
23
+ end
24
+
25
+ # Delete a media_set
26
+ def delete_media_set(id)
27
+ delete "media_sets/#{id}"
28
+ end
29
+
30
+ # Add assets to media_set
31
+ def media_set_add_assets(media_set_id, data)
32
+ put "media_sets/#{media_set_id}/add_assets", data
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,26 @@
1
+ module Voog
2
+ class API
3
+ module Nodes
4
+
5
+ # List nodes
6
+ def nodes(params = {})
7
+ get 'nodes', {query: params}
8
+ end
9
+
10
+ # Get a single node
11
+ def node(id, params = {})
12
+ get "nodes/#{id}", {query: params}
13
+ end
14
+
15
+ # Update a node
16
+ def update_node(id, data)
17
+ put "nodes/#{id}", data
18
+ end
19
+
20
+ # Reorder a node
21
+ def move_node(node_id, params)
22
+ put "nodes/#{node_id}/move", nil, {query: params}
23
+ end
24
+ end
25
+ end
26
+ end