gds-api-adapters 95.1.0 → 96.0.1
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/email_alert_api.rb +0 -13
- data/lib/gds_api/{imminence.rb → places_manager.rb} +1 -1
- data/lib/gds_api/test_helpers/email_alert_api.rb +0 -18
- data/lib/gds_api/test_helpers/{imminence.rb → places_manager.rb} +10 -10
- data/lib/gds_api/version.rb +1 -1
- data/lib/gds_api.rb +5 -5
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97f27ebc485a71a0b76119ca9e0f8b4544b6da2e77f74730ac7a641c7056fa12
|
4
|
+
data.tar.gz: 716e69344154e3cc0bed94ac564f9e1aa598f5b51c86873dc60d61d2449f8b23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3943261403391e42f4ff59e0eade97bcb45830e69bf8b267e7b9b9da73019c8344d59ddcbc3ea10e766ca299bbe0a900ba8528a60e021fa7b0cdd3c098c53e65
|
7
|
+
data.tar.gz: f518c237981c112048dfc205cfe8f3cdd57c4ae3398bbb0917e1b1b4e556e4da1e99099b9f2f31cb5783c564c01b62d7ee6f2254cf76ff75c84b9a1242687e23
|
@@ -273,19 +273,6 @@ class GdsApi::EmailAlertApi < GdsApi::Base
|
|
273
273
|
)
|
274
274
|
end
|
275
275
|
|
276
|
-
# Migrate all users from one existing subscriber list to another existing subscriber list
|
277
|
-
#
|
278
|
-
# @param [string] to_slug Identifier for the successor subscription list
|
279
|
-
# @param [string] from_slug Identifier for the source subscription list
|
280
|
-
|
281
|
-
def bulk_migrate(from_slug:, to_slug:)
|
282
|
-
post_json(
|
283
|
-
"#{endpoint}/subscriber-lists/bulk-migrate",
|
284
|
-
from_slug:,
|
285
|
-
to_slug:,
|
286
|
-
)
|
287
|
-
end
|
288
|
-
|
289
276
|
# Update subscriber list details, such as title
|
290
277
|
# @param [Hash] params A hash of detail paramaters that can be updated. For example title.
|
291
278
|
# For allowed parameters see:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative "base"
|
2
2
|
|
3
|
-
class GdsApi::
|
3
|
+
class GdsApi::PlacesManager < GdsApi::Base
|
4
4
|
def api_url(type, params)
|
5
5
|
vals = %i[limit lat lng postcode local_authority_slug].select { |p| params.include? p }
|
6
6
|
querystring = URI.encode_www_form(vals.map { |p| [p, params[p]] })
|
@@ -466,24 +466,6 @@ module GdsApi
|
|
466
466
|
.to_return(status: 422)
|
467
467
|
end
|
468
468
|
|
469
|
-
def stub_email_alert_api_bulk_migrate(from_slug:, to_slug:)
|
470
|
-
stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/bulk-migrate")
|
471
|
-
.with(body: { from_slug:, to_slug: }.to_json)
|
472
|
-
.to_return(status: 202)
|
473
|
-
end
|
474
|
-
|
475
|
-
def stub_email_alert_api_bulk_migrate_bad_request(from_slug:, to_slug:)
|
476
|
-
stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/bulk-migrate")
|
477
|
-
.with(body: { from_slug:, to_slug: }.to_json)
|
478
|
-
.to_return(status: 422)
|
479
|
-
end
|
480
|
-
|
481
|
-
def stub_email_alert_api_bulk_migrate_not_found(from_slug:, to_slug:)
|
482
|
-
stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/bulk-migrate")
|
483
|
-
.with(body: { from_slug:, to_slug: }.to_json)
|
484
|
-
.to_return(status: 404)
|
485
|
-
end
|
486
|
-
|
487
469
|
def stub_update_subscriber_list_details(slug:, params:)
|
488
470
|
stub_request(:patch, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/#{slug}")
|
489
471
|
.with(body: params.to_json)
|
@@ -2,32 +2,32 @@ require "gds_api/test_helpers/json_client_helper"
|
|
2
2
|
|
3
3
|
module GdsApi
|
4
4
|
module TestHelpers
|
5
|
-
module
|
5
|
+
module PlacesManager
|
6
6
|
# Generally true. If you are initializing the client differently,
|
7
7
|
# you could redefine/override the constant or stub directly.
|
8
|
-
|
8
|
+
PLACES_MANAGER_API_ENDPOINT = Plek.find("places-manager")
|
9
9
|
|
10
|
-
def
|
10
|
+
def stub_places_manager_has_places(latitude, longitude, details)
|
11
11
|
query_hash = { "lat" => latitude, "lng" => longitude, "limit" => "5" }
|
12
12
|
response_data = {
|
13
13
|
status: "ok",
|
14
14
|
content: "places",
|
15
15
|
places: details["details"],
|
16
16
|
}
|
17
|
-
|
17
|
+
stub_places_manager_places_request(details["slug"], query_hash, response_data)
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
20
|
+
def stub_places_manager_has_multiple_authorities_for_postcode(addresses, slug, postcode, limit)
|
21
21
|
query_hash = { "postcode" => postcode, "limit" => limit }
|
22
22
|
response_data = {
|
23
23
|
status: "address-information-required",
|
24
24
|
content: "addresses",
|
25
25
|
addresses:,
|
26
26
|
}
|
27
|
-
|
27
|
+
stub_places_manager_places_request(slug, query_hash, response_data)
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def stub_places_manager_has_places_for_postcode(places, slug, postcode, limit, local_authority_slug)
|
31
31
|
query_hash = { "postcode" => postcode, "limit" => limit }
|
32
32
|
query_hash.merge!(local_authority_slug:) if local_authority_slug
|
33
33
|
response_data = {
|
@@ -35,11 +35,11 @@ module GdsApi
|
|
35
35
|
content: "places",
|
36
36
|
places:,
|
37
37
|
}
|
38
|
-
|
38
|
+
stub_places_manager_places_request(slug, query_hash, response_data)
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
42
|
-
stub_request(:get, "#{
|
41
|
+
def stub_places_manager_places_request(slug, query_hash, return_data, status_code = 200)
|
42
|
+
stub_request(:get, "#{PLACES_MANAGER_API_ENDPOINT}/places/#{slug}.json")
|
43
43
|
.with(query: query_hash)
|
44
44
|
.to_return(status: status_code, body: return_data.to_json, headers: {})
|
45
45
|
end
|
data/lib/gds_api/version.rb
CHANGED
data/lib/gds_api.rb
CHANGED
@@ -6,7 +6,7 @@ require "gds_api/asset_manager"
|
|
6
6
|
require "gds_api/calendars"
|
7
7
|
require "gds_api/content_store"
|
8
8
|
require "gds_api/email_alert_api"
|
9
|
-
require "gds_api/
|
9
|
+
require "gds_api/places_manager"
|
10
10
|
require "gds_api/licence_application"
|
11
11
|
require "gds_api/link_checker_api"
|
12
12
|
require "gds_api/local_links_manager"
|
@@ -82,11 +82,11 @@ module GdsApi
|
|
82
82
|
)
|
83
83
|
end
|
84
84
|
|
85
|
-
# Creates a GdsApi::
|
85
|
+
# Creates a GdsApi::PlacesManager adapter
|
86
86
|
#
|
87
|
-
# @return [GdsApi::
|
88
|
-
def self.
|
89
|
-
GdsApi::
|
87
|
+
# @return [GdsApi::PlacesManager]
|
88
|
+
def self.places_manager(options = {})
|
89
|
+
GdsApi::PlacesManager.new(Plek.find("places-manager"), options)
|
90
90
|
end
|
91
91
|
|
92
92
|
# Creates a GdsApi::LicenceApplication
|
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: 96.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -337,7 +337,6 @@ files:
|
|
337
337
|
- lib/gds_api/email_alert_api.rb
|
338
338
|
- lib/gds_api/exceptions.rb
|
339
339
|
- lib/gds_api/govuk_headers.rb
|
340
|
-
- lib/gds_api/imminence.rb
|
341
340
|
- lib/gds_api/json_client.rb
|
342
341
|
- lib/gds_api/licence_application.rb
|
343
342
|
- lib/gds_api/link_checker_api.rb
|
@@ -347,6 +346,7 @@ files:
|
|
347
346
|
- lib/gds_api/maslow.rb
|
348
347
|
- lib/gds_api/middleware/govuk_header_sniffer.rb
|
349
348
|
- lib/gds_api/organisations.rb
|
349
|
+
- lib/gds_api/places_manager.rb
|
350
350
|
- lib/gds_api/publishing_api.rb
|
351
351
|
- lib/gds_api/publishing_api/special_route_publisher.rb
|
352
352
|
- lib/gds_api/railtie.rb
|
@@ -363,13 +363,13 @@ files:
|
|
363
363
|
- lib/gds_api/test_helpers/content_item_helpers.rb
|
364
364
|
- lib/gds_api/test_helpers/content_store.rb
|
365
365
|
- lib/gds_api/test_helpers/email_alert_api.rb
|
366
|
-
- lib/gds_api/test_helpers/imminence.rb
|
367
366
|
- lib/gds_api/test_helpers/json_client_helper.rb
|
368
367
|
- lib/gds_api/test_helpers/licence_application.rb
|
369
368
|
- lib/gds_api/test_helpers/link_checker_api.rb
|
370
369
|
- lib/gds_api/test_helpers/local_links_manager.rb
|
371
370
|
- lib/gds_api/test_helpers/locations_api.rb
|
372
371
|
- lib/gds_api/test_helpers/organisations.rb
|
372
|
+
- lib/gds_api/test_helpers/places_manager.rb
|
373
373
|
- lib/gds_api/test_helpers/publishing_api.rb
|
374
374
|
- lib/gds_api/test_helpers/router.rb
|
375
375
|
- lib/gds_api/test_helpers/search.rb
|
@@ -402,7 +402,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
402
402
|
- !ruby/object:Gem::Version
|
403
403
|
version: '0'
|
404
404
|
requirements: []
|
405
|
-
rubygems_version: 3.5.
|
405
|
+
rubygems_version: 3.5.10
|
406
406
|
signing_key:
|
407
407
|
specification_version: 4
|
408
408
|
summary: Adapters to work with GDS APIs
|