gds-api-adapters 80.0.0 → 80.0.1

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: 1f6921e5174a36bd20b7d8f6a446d4764778acac96e707108ed4fd581d8261e8
4
- data.tar.gz: 00b4f87f11ee027458c97f21216c43ba42ad371faedbc1ce4e3cb5d886b32126
3
+ metadata.gz: d176cb409b66bc4df5c376c244660cd23fe992e70fa982b3d3403638a97855e4
4
+ data.tar.gz: 507564fc5d9cde9f3bcb9d20ef056a273dd1ff6f7f79a7e4631141cd46ed92bb
5
5
  SHA512:
6
- metadata.gz: 62c4ee4274480082f184e019de3307961b94b2e14840a5e7a9ddf82c1521bc35e66586414bf6a5465e1e06c0c3213194945c84ad48ea0801f8f5e430bb8b2280
7
- data.tar.gz: 26baf319e1e5a0072692b570330bb0bb44fbf17d9f2fb43765f39ae9307ecb7c0ca25da823d30e960f5100362d645d47fce8e3717a4667f3533e4dd9615b3748
6
+ metadata.gz: 18f2478cee5688ec61a3c55b4f010b6bc1dd663929b8313b17affbc4056f78825e008a448242c30668a4acd0cd6fbbc118df4eb691bfa913f5aba76461cbe017
7
+ data.tar.gz: 3ecfd09796febbb411404015894024df599b2edb733a0658d730057f5c90e9a60926fa1bfd73a9c258db0a6e24282c41e9d548ba7a04b161f1d39550f827b10b
@@ -252,7 +252,7 @@ class GdsApi::EmailAlertApi < GdsApi::Base
252
252
  # optionally send a notification email explaining the reason
253
253
  #
254
254
  # @param [string] slug Identifier for the subscription list
255
- # @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) govuk_request_id An ID allowing us to trace requests across our infra. Required if you want to send an email by running out-of-band processes via asynchronous workers.
256
256
  # @param [string] (optional) body Optional email body to send to alert users they are being unsubscribed. Required if you want to send an email
257
257
  # @param [string] (optional) sender_message_id A UUID to prevent multiple emails for the same event. Required if you want to send an email.
258
258
  def bulk_unsubscribe(slug:, govuk_request_id: nil, body: nil, sender_message_id: nil)
@@ -413,15 +413,15 @@ module GdsApi
413
413
  .to_return(status: 202)
414
414
  end
415
415
 
416
- def stub_email_alert_api_bulk_unsubscribe_with_message(slug:, govuk_request_id:, body:, sender_message_id:)
416
+ def stub_email_alert_api_bulk_unsubscribe_with_message(slug:, body:, sender_message_id:, govuk_request_id: nil)
417
417
  stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/#{slug}/bulk-unsubscribe")
418
- .with(
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 },
424
- ).to_return(status: 202)
423
+ }.tap { |attr| attr[:headers] = { "Govuk-Request-Id" => govuk_request_id } if govuk_request_id })
424
+ .to_return(status: 202)
425
425
  end
426
426
 
427
427
  def stub_email_alert_api_bulk_unsubscribe_not_found(slug:)
@@ -429,15 +429,15 @@ module GdsApi
429
429
  .to_return(status: 404)
430
430
  end
431
431
 
432
- def stub_email_alert_api_bulk_unsubscribe_not_found_with_message(slug:, govuk_request_id:, body:, sender_message_id:)
432
+ def stub_email_alert_api_bulk_unsubscribe_not_found_with_message(slug:, body:, sender_message_id:, govuk_request_id: nil)
433
433
  stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/#{slug}/bulk-unsubscribe")
434
- .with(
434
+ .with({
435
435
  body: {
436
436
  body: body,
437
437
  sender_message_id: sender_message_id,
438
438
  }.to_json,
439
- headers: { "Govuk-Request-Id" => govuk_request_id },
440
- ).to_return(status: 404)
439
+ }.tap { |attr| attr[:headers] = { "Govuk-Request-Id" => govuk_request_id } if govuk_request_id })
440
+ .to_return(status: 404)
441
441
  end
442
442
 
443
443
  def stub_email_alert_api_bulk_unsubscribe_conflict(slug:)
@@ -445,15 +445,15 @@ module GdsApi
445
445
  .to_return(status: 409)
446
446
  end
447
447
 
448
- def stub_email_alert_api_bulk_unsubscribe_conflict_with_message(slug:, govuk_request_id:, body:, sender_message_id:)
448
+ def stub_email_alert_api_bulk_unsubscribe_conflict_with_message(slug:, body:, sender_message_id:, govuk_request_id: nil)
449
449
  stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/#{slug}/bulk-unsubscribe")
450
- .with(
450
+ .with({
451
451
  body: {
452
452
  body: body,
453
453
  sender_message_id: sender_message_id,
454
454
  }.to_json,
455
- headers: { "Govuk-Request-Id" => govuk_request_id },
456
- ).to_return(status: 409)
455
+ }.tap { |attr| attr[:headers] = { "Govuk-Request-Id" => govuk_request_id } if govuk_request_id })
456
+ .to_return(status: 409)
457
457
  end
458
458
 
459
459
  def stub_email_alert_api_bulk_unsubscribe_bad_request(slug:)
@@ -461,15 +461,15 @@ module GdsApi
461
461
  .to_return(status: 422)
462
462
  end
463
463
 
464
- def stub_email_alert_api_bulk_unsubscribe_bad_request_with_message(slug:, govuk_request_id:, body:, sender_message_id:)
464
+ def stub_email_alert_api_bulk_unsubscribe_bad_request_with_message(slug:, body:, sender_message_id:, govuk_request_id: nil)
465
465
  stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriber-lists/#{slug}/bulk-unsubscribe")
466
- .with(
466
+ .with({
467
467
  body: {
468
468
  body: body,
469
469
  sender_message_id: sender_message_id,
470
470
  }.to_json,
471
- headers: { "Govuk-Request-Id" => govuk_request_id },
472
- ).to_return(status: 422)
471
+ }.tap { |attr| attr[:headers] = { "Govuk-Request-Id" => govuk_request_id } if govuk_request_id })
472
+ .to_return(status: 422)
473
473
  end
474
474
 
475
475
  def stub_update_subscriber_list_details(slug:, params:)
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = "80.0.0".freeze
2
+ VERSION = "80.0.1".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: 80.0.0
4
+ version: 80.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: 2022-06-21 00:00:00.000000000 Z
11
+ date: 2022-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable