nimbu-api 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nimbu-api/endpoints/themes/assets.rb +5 -1
- data/lib/nimbu-api/endpoints/themes/layouts.rb +5 -2
- data/lib/nimbu-api/endpoints/themes/snippets.rb +5 -1
- data/lib/nimbu-api/endpoints/themes/templates.rb +5 -1
- data/lib/nimbu-api/errors.rb +1 -1
- data/lib/nimbu-api/errors/conflict.rb +15 -0
- data/lib/nimbu-api/errors/service_error.rb +5 -1
- data/lib/nimbu-api/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1753fb1b4a42d33db4e811d339fa12a22c718bca2e594b3c66cac115ba5622f
|
4
|
+
data.tar.gz: 757a0842074ae620943ab3c54d043b2d283979cbd20c21cc14a851702114a4b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ed6b315b7c4944d9fcde7ba435a262647d44f8e5dcbdcbd1757a964e9bbd144e76e395e7b1b2696dcce242cac754b389df4fb9f1f3b96be0a826baee74cc137
|
7
|
+
data.tar.gz: 3ea22e57195ecd045fb89250064e6433cbee20ebee130c36252e801e687e56d114ce4f0716607440a0ac6750f4cf349156cd7c4de84174c8dba35ceec83b10c9
|
@@ -7,7 +7,11 @@ module Nimbu
|
|
7
7
|
def create(*args)
|
8
8
|
arguments(args, :required => [:theme_id])
|
9
9
|
|
10
|
-
|
10
|
+
forced = arguments.params.delete("force")
|
11
|
+
query_params = {}
|
12
|
+
query_params = {force: forced} unless forced.nil?
|
13
|
+
|
14
|
+
post_request("/themes/#{theme_id}/assets", arguments.params, {:with_attachments => true, :params => query_params})
|
11
15
|
end
|
12
16
|
|
13
17
|
def delete(*args)
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
|
3
2
|
module Nimbu
|
4
3
|
module Endpoints
|
5
4
|
class Themes::Layouts < Endpoint
|
@@ -7,7 +6,11 @@ module Nimbu
|
|
7
6
|
def create(*args)
|
8
7
|
arguments(args, :required => [:theme_id])
|
9
8
|
|
10
|
-
|
9
|
+
forced = arguments.params.delete("force")
|
10
|
+
query_params = {}
|
11
|
+
query_params = {force: forced} unless forced.nil?
|
12
|
+
|
13
|
+
post_request("/themes/#{theme_id}/layouts", arguments.params, params: query_params)
|
11
14
|
end
|
12
15
|
|
13
16
|
def get(*args)
|
@@ -7,7 +7,11 @@ module Nimbu
|
|
7
7
|
def create(*args)
|
8
8
|
arguments(args, :required => [:theme_id])
|
9
9
|
|
10
|
-
|
10
|
+
forced = arguments.params.delete("force")
|
11
|
+
query_params = {}
|
12
|
+
query_params = {force: forced} unless forced.nil?
|
13
|
+
|
14
|
+
post_request("/themes/#{theme_id}/snippets", arguments.params, params: query_params)
|
11
15
|
end
|
12
16
|
|
13
17
|
def get(*args)
|
@@ -7,7 +7,11 @@ module Nimbu
|
|
7
7
|
def create(*args)
|
8
8
|
arguments(args, :required => [:theme_id])
|
9
9
|
|
10
|
-
|
10
|
+
forced = arguments.params.delete("force")
|
11
|
+
query_params = {}
|
12
|
+
query_params = {force: forced} unless forced.nil?
|
13
|
+
|
14
|
+
post_request("/themes/#{theme_id}/templates", arguments.params, params: query_params)
|
11
15
|
end
|
12
16
|
|
13
17
|
def get(*args)
|
data/lib/nimbu-api/errors.rb
CHANGED
@@ -26,6 +26,6 @@ module Nimbu
|
|
26
26
|
end # Error
|
27
27
|
end # Nimbu
|
28
28
|
|
29
|
-
%w( service_error bad_request bad_gateway unauthorized forbidden not_found not_acceptable unprocessable_entity internal_server_error service_unavailable client_error invalid_options required_params unknown_value validations ).each do |error|
|
29
|
+
%w( service_error bad_request bad_gateway unauthorized forbidden not_found not_acceptable unprocessable_entity internal_server_error service_unavailable client_error invalid_options required_params unknown_value validations conflict ).each do |error|
|
30
30
|
require "nimbu-api/errors/#{error}"
|
31
31
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Nimbu #:nodoc
|
4
|
+
# Raised when Nimbu returns the HTTP status code 409
|
5
|
+
module Error
|
6
|
+
class Conflict < ServiceError
|
7
|
+
http_status_code 409
|
8
|
+
|
9
|
+
def initialize(response)
|
10
|
+
super(response)
|
11
|
+
end
|
12
|
+
|
13
|
+
end # NotAcceptable
|
14
|
+
end # Error
|
15
|
+
end # Nimbu
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# require 'multi_json'
|
3
|
-
require 'nimbu-api/utils/json'
|
3
|
+
require 'nimbu-api/utils/json'
|
4
4
|
|
5
5
|
module Nimbu
|
6
6
|
# Raised when Nimbu returns any of the HTTP status codes
|
@@ -11,8 +11,12 @@ module Nimbu
|
|
11
11
|
attr_reader :http_headers
|
12
12
|
attr_reader :http_body
|
13
13
|
|
14
|
+
attr_reader :status
|
15
|
+
|
14
16
|
def initialize(response)
|
15
17
|
@http_headers = response[:response_headers]
|
18
|
+
@status = response[:status]
|
19
|
+
|
16
20
|
message = parse_response(response)
|
17
21
|
super(message)
|
18
22
|
end
|
data/lib/nimbu-api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nimbu-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Dedene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
@@ -212,6 +212,7 @@ files:
|
|
212
212
|
- lib/nimbu-api/errors/bad_gateway.rb
|
213
213
|
- lib/nimbu-api/errors/bad_request.rb
|
214
214
|
- lib/nimbu-api/errors/client_error.rb
|
215
|
+
- lib/nimbu-api/errors/conflict.rb
|
215
216
|
- lib/nimbu-api/errors/forbidden.rb
|
216
217
|
- lib/nimbu-api/errors/internal_server_error.rb
|
217
218
|
- lib/nimbu-api/errors/invalid_options.rb
|