gds-api-adapters 78.0.0 → 78.1.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
  SHA256:
3
- metadata.gz: 5a423ee043ccb33b30d2d1a0f12b0a5f43d14018b774afa6270f24626062f696
4
- data.tar.gz: e18aa2ed41343e430781063d9a8e85584213781758a245f8c818849c9d51e30d
3
+ metadata.gz: 4aced99bb9908549cfe0a2d8f2a57df4e799d55fe7df796f3f29ae7361884694
4
+ data.tar.gz: 29835f7a98aaf0cb5e4feadd57de90a2c01231a7dc12f28f5aa99845994a5a9d
5
5
  SHA512:
6
- metadata.gz: 2113447106f41212696c5daf6e048c1bf0df7feac8b524d63a437f8113d8cb4cf9e2a9910e898c55a6501d7495548ff131142a4cdccf3e4287b327be54320a4d
7
- data.tar.gz: 74a1d841906f75f5f9f045f8157e8bf40ace3a4e12e6b30226d07e3e1959267d4b66821e72e2d0812cb1ee951b1a99724e71b60bbf8e057bd8aea7ee60622153
6
+ metadata.gz: 9f6a041fb8a075caafd88fc3f7828cd41be441ad1b491f5c738bfb3b726bd34993d30eaf52c83da3f55d19ce40267a6141e2221e8fef4a9d5682cede429537a2
7
+ data.tar.gz: 0d47922f059483ff795bac96f673f8bb51284a544b0af926e4aa7afbbd6f53c9310a371d53107dd2b1fba3b5656ac8c60fbf6cb0af490b8e295a261958a5b055
@@ -251,15 +251,19 @@ class GdsApi::EmailAlertApi < GdsApi::Base
251
251
  # optionally send a notification email explaining the reason
252
252
  #
253
253
  # @param [string] slug Identifier for the subscription list
254
- # @param [string] (optional) body Optional email body to send to alert users they are being unsubscribed
255
- # @param [string] (optional) sender_message_id A UUID to prevent multiple emails for the same event
256
- def bulk_unsubscribe(slug:, body: nil, sender_message_id: nil)
254
+ # @param [string] (optional) govuk_request_id An ID allowing us to trace requests across our infra. Required if you want to send an email.
255
+ # @param [string] (optional) body Optional email body to send to alert users they are being unsubscribed. Required if you want to send an email
256
+ # @param [string] (optional) sender_message_id A UUID to prevent multiple emails for the same event. Required if you want to send an email.
257
+ def bulk_unsubscribe(slug:, govuk_request_id: nil, body: nil, sender_message_id: nil)
257
258
  post_json(
258
259
  "#{endpoint}/subscriber-lists/#{slug}/bulk-unsubscribe",
259
260
  {
260
261
  body: body,
261
262
  sender_message_id: sender_message_id,
262
263
  }.compact,
264
+ {
265
+ "Govuk-Request-Id" => govuk_request_id,
266
+ }.compact,
263
267
  )
264
268
  end
265
269
 
@@ -413,13 +413,14 @@ module GdsApi
413
413
  .to_return(status: 202)
414
414
  end
415
415
 
416
- def stub_email_alert_api_bulk_unsubscribe_with_message(slug:, body:, sender_message_id:)
416
+ def stub_email_alert_api_bulk_unsubscribe_with_message(slug:, govuk_request_id:, body:, sender_message_id:)
417
417
  stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/#{slug}/bulk-unsubscribe")
418
418
  .with(
419
419
  body: {
420
420
  body: body,
421
421
  sender_message_id: sender_message_id,
422
422
  }.to_json,
423
+ headers: { "Govuk-Request-Id" => govuk_request_id },
423
424
  ).to_return(status: 202)
424
425
  end
425
426
 
@@ -428,23 +429,25 @@ module GdsApi
428
429
  .to_return(status: 404)
429
430
  end
430
431
 
431
- def stub_email_alert_api_bulk_unsubscribe_not_found_with_message(slug:, body:, sender_message_id:)
432
+ def stub_email_alert_api_bulk_unsubscribe_not_found_with_message(slug:, govuk_request_id:, body:, sender_message_id:)
432
433
  stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/#{slug}/bulk-unsubscribe")
433
434
  .with(
434
435
  body: {
435
436
  body: body,
436
437
  sender_message_id: sender_message_id,
437
438
  }.to_json,
439
+ headers: { "Govuk-Request-Id" => govuk_request_id },
438
440
  ).to_return(status: 404)
439
441
  end
440
442
 
441
- def stub_email_alert_api_bulk_unsubscribe_conflict_with_message(slug:, body:, sender_message_id:)
443
+ def stub_email_alert_api_bulk_unsubscribe_conflict_with_message(slug:, govuk_request_id:, body:, sender_message_id:)
442
444
  stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/#{slug}/bulk-unsubscribe")
443
445
  .with(
444
446
  body: {
445
447
  body: body,
446
448
  sender_message_id: sender_message_id,
447
449
  }.to_json,
450
+ headers: { "Govuk-Request-Id" => govuk_request_id },
448
451
  ).to_return(status: 409)
449
452
  end
450
453
 
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = "78.0.0".freeze
2
+ VERSION = "78.1.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: 78.0.0
4
+ version: 78.1.0
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: 2022-01-18 00:00:00.000000000 Z
11
+ date: 2022-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable