gds-api-adapters 49.8.0 → 50.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gds_api/router.rb +6 -9
- data/lib/gds_api/version.rb +1 -1
- metadata +2 -3
- data/lib/gds_api/need_api.rb +0 -55
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46a41a00cacd79a4c408b3c597b139d651257bdd
|
4
|
+
data.tar.gz: f3b857e23608ba7bce531856288d01d808438e27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fb13e953ff52783dd4cde9e95db5b8fae4a649fd0d5f7649628605d7744d15665642ff9ab4d1b48acdf5cac7b8ecbaa02bf6ecaee68e90ae56204429dfe3c6f
|
7
|
+
data.tar.gz: '048ce4c05a7677cc8011f99be2bdc4b244b446ed3494c28b49c530691f3909ea812057d51591f0f48ac9f417b82bdf1d786b360f8a3e8a9779805262d810f27d'
|
data/lib/gds_api/router.rb
CHANGED
@@ -53,15 +53,12 @@ class GdsApi::Router < GdsApi::Base
|
|
53
53
|
response
|
54
54
|
end
|
55
55
|
|
56
|
-
def delete_route(path,
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
end
|
63
|
-
response = delete_json("#{endpoint}/routes?incoming_path=#{CGI.escape(path)}")
|
64
|
-
commit_routes if options[:commit]
|
56
|
+
def delete_route(path, hard_delete: false, commit: false)
|
57
|
+
url = "#{endpoint}/routes?incoming_path=#{CGI.escape(path)}"
|
58
|
+
url += "&hard_delete=true" if hard_delete
|
59
|
+
|
60
|
+
response = delete_json(url)
|
61
|
+
commit_routes if commit
|
65
62
|
response
|
66
63
|
end
|
67
64
|
|
data/lib/gds_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gds-api-adapters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 50.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Stewart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plek
|
@@ -359,7 +359,6 @@ files:
|
|
359
359
|
- lib/gds_api/mapit.rb
|
360
360
|
- lib/gds_api/maslow.rb
|
361
361
|
- lib/gds_api/middleware/govuk_header_sniffer.rb
|
362
|
-
- lib/gds_api/need_api.rb
|
363
362
|
- lib/gds_api/null_cache.rb
|
364
363
|
- lib/gds_api/organisations.rb
|
365
364
|
- lib/gds_api/performance_platform/data_in.rb
|
data/lib/gds_api/need_api.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
require_relative 'base'
|
2
|
-
|
3
|
-
class GdsApi::NeedApi < GdsApi::Base
|
4
|
-
def needs(options = {})
|
5
|
-
query = query_string(options)
|
6
|
-
|
7
|
-
get_list("#{endpoint}/needs#{query}")
|
8
|
-
end
|
9
|
-
|
10
|
-
def content_id(need_id)
|
11
|
-
get_raw("#{endpoint}/needs/#{CGI.escape(need_id.to_s)}/content_id")
|
12
|
-
end
|
13
|
-
|
14
|
-
def needs_by_id(*ids)
|
15
|
-
ids_string = ids.flatten.map(&:to_i).sort.join(',')
|
16
|
-
query = query_string(ids: ids_string)
|
17
|
-
|
18
|
-
get_list("#{endpoint}/needs#{query}")
|
19
|
-
end
|
20
|
-
|
21
|
-
def need(need_id)
|
22
|
-
get_json("#{endpoint}/needs/#{CGI.escape(need_id.to_s)}")
|
23
|
-
end
|
24
|
-
|
25
|
-
def create_need(need)
|
26
|
-
post_json("#{endpoint}/needs", need)
|
27
|
-
end
|
28
|
-
|
29
|
-
def update_need(need_id, need_update)
|
30
|
-
# `need_update` can be a hash of updated fields or a complete need
|
31
|
-
put_json("#{endpoint}/needs/#{CGI.escape(need_id.to_s)}", need_update)
|
32
|
-
end
|
33
|
-
|
34
|
-
def organisations
|
35
|
-
get_json("#{endpoint}/organisations")["organisations"]
|
36
|
-
end
|
37
|
-
|
38
|
-
def close(need_id, duplicate_of)
|
39
|
-
# duplicate_of is a hash of the required fields for closing
|
40
|
-
# a need as a duplicate: { "duplicate_of" => 100001,
|
41
|
-
# "author" => { ... }
|
42
|
-
# }
|
43
|
-
put_json("#{endpoint}/needs/#{CGI.escape(need_id.to_s)}/closed", duplicate_of)
|
44
|
-
end
|
45
|
-
|
46
|
-
def reopen(need_id, author)
|
47
|
-
# author params: { "author" => { ... } }"
|
48
|
-
# NB: This should really be a POST
|
49
|
-
delete_json_with_params!("#{endpoint}/needs/#{CGI.escape(need_id.to_s)}/closed", author)
|
50
|
-
end
|
51
|
-
|
52
|
-
def create_note(note)
|
53
|
-
post_json("#{endpoint}/notes", note)
|
54
|
-
end
|
55
|
-
end
|