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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 565cb9c62f97ab192f2ae1cd2e206508bd3c9d1b
4
- data.tar.gz: 712159c4958e3440fe33344983e6e1d1a75a15d4
3
+ metadata.gz: 46a41a00cacd79a4c408b3c597b139d651257bdd
4
+ data.tar.gz: f3b857e23608ba7bce531856288d01d808438e27
5
5
  SHA512:
6
- metadata.gz: a2dd889e19663d642c85c98091ec65ed91f90d1d29b7c7ffbd4eb97a6bb34db6ddd71aa622920c1ec999420c210436c8ef385b98d58265365ca870f44049dd64
7
- data.tar.gz: ddbf675bf7758dbaf05c3a42f33856f16e225882c85d028a82068029454aade5ae221cd806f3b6a89157202d097cb5d1c189687c1ba7a307f3b3a23b695d9e59
6
+ metadata.gz: 1fb13e953ff52783dd4cde9e95db5b8fae4a649fd0d5f7649628605d7744d15665642ff9ab4d1b48acdf5cac7b8ecbaa02bf6ecaee68e90ae56204429dfe3c6f
7
+ data.tar.gz: '048ce4c05a7677cc8011f99be2bdc4b244b446ed3494c28b49c530691f3909ea812057d51591f0f48ac9f417b82bdf1d786b360f8a3e8a9779805262d810f27d'
@@ -53,15 +53,12 @@ class GdsApi::Router < GdsApi::Base
53
53
  response
54
54
  end
55
55
 
56
- def delete_route(path, options_or_deprecated_type = {}, deprecated_options = {})
57
- if options_or_deprecated_type.is_a?(String)
58
- $stderr.puts "DEPRECATION WARNING: passing type to GdsApi::Router#delete_route is deprecated and will be removed in a future version. Caller: #{caller[0]}"
59
- options = deprecated_options
60
- else
61
- options = options_or_deprecated_type
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
 
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '49.8.0'.freeze
2
+ VERSION = '50.0.0'.freeze
3
3
  end
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: 49.8.0
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-24 00:00:00.000000000 Z
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
@@ -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