mailgun-ruby 1.2.16 → 1.3.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: 230e91483a287bc0ed69c568a1a76f87eca69685274a5027ab8ada2206930205
4
- data.tar.gz: 78bc23c4966213a45577b279c3de82e01a04292205007d2d07f9b3ad173d0d9f
3
+ metadata.gz: 4cd509b2c1f407b43b66a9ef400bb94845be7bf358ee0516dfc64f8ef9f139b7
4
+ data.tar.gz: aad61052482bfb86b04ef0111a4495346d2b48cf046543c1c2fb600ca06916db
5
5
  SHA512:
6
- metadata.gz: 596a9fec66b1f46fb94d713906b37f472f80f8c2e0187c2df7d88e7609e2658a2c428c3bf68e7f2c41b5adc4a74c647e78f84b4ff94f4431b976d771bb4bf201
7
- data.tar.gz: 94966b3b0325f188a6c9d28fea2e39c45f9a40a7e486f264fac53f111a6c7eada486cf7755698d29f8115b799b9ef39d98160f9ab50d964c48eb60051583f081
6
+ metadata.gz: 452423c6da36c0f23ec08d3a613002027fa80c41f48c3b0a8072ccc35df1230d16512273bce584ea470dc9ba05f557e8a5a617a95efe5305e663d2de4f18b54b
7
+ data.tar.gz: 5b28c5065060bcff51c7711b0a4b32796fa2c79ef83251fff5a11fbd0a573c80f4d7018b289c42d9a3c273d21941ffd7fa8eee3dcd317bf7463a45fd4131899d
data/CHANGELOG.md CHANGED
@@ -25,7 +25,6 @@ All notable changes to this project will be documented in this file.
25
25
  - Additional Domain Endpoints (https://github.com/mailgun/mailgun-ruby/pull/314)
26
26
  - Webhooks Update Method (https://github.com/mailgun/mailgun-ruby/pull/305)
27
27
  - Add support for AMP HTML (https://github.com/mailgun/mailgun-ruby/pull/304)
28
- - Add support for AMP HTML (https://github.com/mailgun/mailgun-ruby/pull/304)
29
28
 
30
29
  ### Fixed
31
30
 
@@ -46,4 +45,4 @@ All notable changes to this project will be documented in this file.
46
45
  ### Fixed
47
46
 
48
47
  - transform_for_mailgun block iteration issue (https://github.com/mailgun/mailgun-ruby/pull/298).
49
- - Typos in several files (https://github.com/mailgun/mailgun-ruby/pull/297).
48
+ - Typos in several files (https://github.com/mailgun/mailgun-ruby/pull/297).
data/Gemfile CHANGED
@@ -3,4 +3,5 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in mailgun.gemspec
4
4
  gemspec
5
5
 
6
+ gem 'mime-types'
6
7
  gem 'json', '~> 2.1', platform: :mri_19
data/README.md CHANGED
@@ -193,6 +193,7 @@ This SDK includes the following components:
193
193
  - [Suppressions](docs/Suppressions.md)
194
194
  - [Templates](docs/Templates.md)
195
195
  - [EmailValidation](docs/EmailValidation.md)
196
+ - [Metrics](docs/Metrics.md)
196
197
 
197
198
  Message Builder allows you to quickly create the array of parameters, required
198
199
  to send a message, by calling a methods for each parameter.
data/docs/Webhooks.md CHANGED
@@ -4,8 +4,7 @@ Mailgun - Webhooks
4
4
  This is the Mailgun Ruby *Webhook* utilities.
5
5
 
6
6
  The below assumes you've already installed the Mailgun Ruby SDK in to your
7
- project. If not, go back to the master README for instructions. It currently supports
8
- all calls except updating webhooks.
7
+ project. If not, go back to the master README for instructions.
9
8
 
10
9
  Usage - Webhooks
11
10
  -----------------------
@@ -27,6 +26,9 @@ hook.create_all 'my.perfect.domain', 'https://the.webhook.url/'
27
26
  # Add a url for a specific webhook
28
27
  hook.create 'my.perfect.domain', 'deliver', 'https://the.webhook.url/'
29
28
 
29
+ # Update the url for a specific webhook
30
+ hook.update 'my.perfect.domain', 'deliver', 'https://the.webhook.url/'
31
+
30
32
  # Remove a url for a specific webhook
31
33
  hook.remove 'my.perfect.domain', 'deliver'
32
34
 
@@ -19,16 +19,26 @@ module Mailgun
19
19
  timeout = nil,
20
20
  proxy_url = Mailgun.proxy_url)
21
21
 
22
- rest_client_params = {
23
- user: 'api',
24
- password: api_key,
25
- user_agent: "mailgun-sdk-ruby/#{Mailgun::VERSION}"
22
+ endpoint = endpoint_generator(api_host, api_version, ssl)
23
+
24
+ request_options = {
25
+ url: endpoint,
26
+ proxy: Mailgun.proxy_url,
27
+ ssl: {verify: ssl},
28
+ headers: {
29
+ 'User-Agent' => "mailgun-sdk-ruby/#{Mailgun::VERSION}",
30
+ 'Accept' =>'*/*'
31
+ }
26
32
  }
27
- rest_client_params[:timeout] = timeout if timeout
33
+ request_options.merge!(request: {timeout: timeout}) if timeout
34
+
35
+ @http_client = Faraday.new(request_options) do |conn|
36
+ conn.request :authorization, :basic, 'api', api_key
37
+ conn.request :url_encoded
38
+ conn.response :raise_error, include_request: true
39
+ conn.adapter Faraday.default_adapter
40
+ end
28
41
 
29
- endpoint = endpoint_generator(api_host, api_version, ssl)
30
- RestClient.proxy = proxy_url
31
- @http_client = RestClient::Resource.new(endpoint, rest_client_params)
32
42
  @test_mode = test_mode
33
43
  @api_version = api_version
34
44
  end
@@ -49,17 +59,17 @@ module Mailgun
49
59
 
50
60
  # Change API key
51
61
  def set_api_key(api_key)
52
- @http_client.options[:password] = api_key
62
+ @http_client.set_basic_auth('api', api_key)
53
63
  end
54
64
 
55
65
  # Add subaccount id to headers
56
66
  def set_subaccount(subaccount_id)
57
- @http_client.options[:headers] = { SUBACCOUNT_HEADER => subaccount_id }
67
+ @http_client.headers = @http_client.headers.merge!({ SUBACCOUNT_HEADER => subaccount_id })
58
68
  end
59
69
 
60
70
  # Reset subaccount for primary usage
61
71
  def reset_subaccount
62
- @http_client.options[:headers].delete(SUBACCOUNT_HEADER)
72
+ @http_client.headers.delete(SUBACCOUNT_HEADER)
63
73
  end
64
74
 
65
75
  # Client is in test mode?
@@ -95,7 +105,7 @@ module Mailgun
95
105
  return Response.from_hash(
96
106
  {
97
107
  :body => "{\"id\": \"test-mode-mail-#{SecureRandom.uuid}@localhost\", \"message\": \"Queued. Thank you.\"}",
98
- :code => 200,
108
+ :status => 200,
99
109
  }
100
110
  )
101
111
  end
@@ -130,7 +140,7 @@ module Mailgun
130
140
  # @param [Hash] headers Additional headers to pass to the resource.
131
141
  # @return [Mailgun::Response] A Mailgun::Response object.
132
142
  def post(resource_path, data, headers = {})
133
- response = @http_client[resource_path].post(data, headers)
143
+ response = @http_client.post(resource_path, data, headers)
134
144
  Response.new(response)
135
145
  rescue => err
136
146
  raise communication_error err
@@ -138,21 +148,19 @@ module Mailgun
138
148
 
139
149
  # Generic Mailgun GET Handler
140
150
  #
141
- # @param [String] resource_path This is the API resource you wish to interact
142
- # with. Be sure to include your domain, where necessary.
143
- # @param [Hash] params This should be a standard Hash
144
- # containing required parameters for the requested resource.
145
- # @param [String] accept Acceptable Content-Type of the response body.
146
- # @return [Mailgun::Response] A Mailgun::Response object.
147
- def get(resource_path, params = nil, accept = '*/*')
148
- if params
149
- response = @http_client[resource_path].get(params: params, accept: accept)
150
- else
151
- response = @http_client[resource_path].get(accept: accept)
152
- end
151
+ # @param [String] resource_path The API resource path to request, including the domain if required.
152
+ # @param [Hash] params Optional request parameters, including query parameters and headers.
153
+ # - `:headers` [Hash] (optional) Custom headers for the request.
154
+ # @param [String] accept The expected Content-Type of the response. Defaults to '*/*'.
155
+ # @return [Mailgun::Response] A response object containing the API response data.
156
+ # @raise [CommunicationError] If the request fails, raises a communication error.
157
+ def get(resource_path, params = {}, accept = '*/*')
158
+ headers = (params[:headers] || {}).merge(accept: accept)
159
+ response = @http_client.get(resource_path, params, headers)
160
+
153
161
  Response.new(response)
154
162
  rescue => err
155
- raise communication_error err
163
+ raise communication_error(err)
156
164
  end
157
165
 
158
166
  # Generic Mailgun PUT Handler
@@ -163,7 +171,7 @@ module Mailgun
163
171
  # containing required parameters for the requested resource.
164
172
  # @return [Mailgun::Response] A Mailgun::Response object.
165
173
  def put(resource_path, data)
166
- response = @http_client[resource_path].put(data)
174
+ response = @http_client.put(resource_path, data)
167
175
  Response.new(response)
168
176
  rescue => err
169
177
  raise communication_error err
@@ -176,9 +184,9 @@ module Mailgun
176
184
  # @return [Mailgun::Response] A Mailgun::Response object.
177
185
  def delete(resource_path, params = nil)
178
186
  if params
179
- response = @http_client[resource_path].delete(params: params)
187
+ response = @http_client.delete(resource_path, params: params)
180
188
  else
181
- response = @http_client[resource_path].delete
189
+ response = @http_client.delete(resource_path)
182
190
  end
183
191
  Response.new(response)
184
192
  rescue => err
@@ -227,7 +235,7 @@ module Mailgun
227
235
  # @param [StandardException] e upstream exception object
228
236
  def communication_error(e)
229
237
  if e.respond_to?(:response) && e.response
230
- return case e.response.code
238
+ return case e.response_status
231
239
  when Unauthorized::CODE
232
240
  Unauthorized.new(e.message, e.response)
233
241
  when BadRequest::CODE
@@ -29,7 +29,7 @@ module Mailgun
29
29
  # params - a Hash of query options and/or filters.
30
30
  #
31
31
  # Returns a Mailgun::Response object.
32
- def get(params = nil)
32
+ def get(params = {})
33
33
  self.next(params)
34
34
  end
35
35
 
@@ -40,7 +40,7 @@ module Mailgun
40
40
  # params - a Hash of query options and/or filters.
41
41
  #
42
42
  # Returns a Mailgun::Response object.
43
- def next(params = nil)
43
+ def next(params = {})
44
44
  get_events(params, @paging_next)
45
45
  end
46
46
 
@@ -51,7 +51,7 @@ module Mailgun
51
51
  # params - a Hash of query options and/or filters.
52
52
  #
53
53
  # Returns Mailgun::Response object.
54
- def previous(params = nil)
54
+ def previous(params = {})
55
55
  get_events(params, @paging_previous)
56
56
  end
57
57
 
@@ -75,7 +75,7 @@ module Mailgun
75
75
  # paging - the URL key used for previous/next requests
76
76
  #
77
77
  # Returns a Mailgun.Response object.
78
- def get_events(params = nil, paging = nil)
78
+ def get_events(params = {}, paging = nil)
79
79
  response = @client.get(construct_url(paging), params)
80
80
  extract_paging(response)
81
81
  response
@@ -29,10 +29,10 @@ module Mailgun
29
29
  # Public: Class for managing communications (eg http) response errors
30
30
  # Inherits from Mailgun::Error
31
31
  class CommunicationError < Error
32
- # Public: gets HTTP status code
33
- attr_reader :code
32
+ # Public: gets HTTP status status
33
+ attr_reader :status
34
34
 
35
- # Public: fallback if there is no response code on the object
35
+ # Public: fallback if there is no response status on the object
36
36
  NOCODE = 000
37
37
  FORBIDDEN = 'Forbidden'
38
38
 
@@ -43,17 +43,17 @@ module Mailgun
43
43
  #
44
44
  def initialize(message = nil, response = nil)
45
45
  @response = response
46
- @code = if response.nil?
46
+ @status = if response.nil?
47
47
  NOCODE
48
48
  else
49
- response.code
49
+ response.status
50
50
  end
51
51
 
52
52
  begin
53
53
  json = JSON.parse(response.body)
54
54
  api_message = json['message'] || json['Error'] || json['error']
55
55
  rescue JSON::ParserError
56
- api_message = response.body
56
+ api_message = response.response_body
57
57
  rescue NoMethodError
58
58
  api_message = "Unknown API error"
59
59
  rescue
@@ -65,7 +65,7 @@ module Mailgun
65
65
 
66
66
  super(message, response)
67
67
  rescue NoMethodError, JSON::ParserError
68
- @code = NOCODE
68
+ @status = NOCODE
69
69
  super(message, response)
70
70
  end
71
71
  end
@@ -6,19 +6,20 @@ module Mailgun
6
6
  #
7
7
  # See the Github documentation for full examples.
8
8
  class Response
9
- # All responses have a payload and a code corresponding to http, though
9
+ # All responses have a payload and a status corresponding to http, though
10
10
  # slightly different
11
- attr_accessor :body, :code
11
+ attr_accessor :body, :status, :code
12
12
 
13
- ResponseHash = Struct.new(:body, :code)
13
+ ResponseHash = Struct.new(:body, :status)
14
14
  def self.from_hash(h)
15
15
  # Create a "fake" response object with the data passed from h
16
- self.new ResponseHash.new(h[:body], h[:code])
16
+ self.new ResponseHash.new(h[:body], h[:status])
17
17
  end
18
18
 
19
19
  def initialize(response)
20
20
  @body = response.body
21
- @code = response.code
21
+ @status = response.status
22
+ @code = response.status
22
23
  end
23
24
 
24
25
  # Return response as Ruby Hash
@@ -57,12 +58,12 @@ module Mailgun
57
58
  rescue => err
58
59
  raise ParseError.new(err), err
59
60
  end
60
-
61
- # Returns true if response code is 2xx
62
- #
63
- # @return [Boolean] A boolean that binarizes the response code result.
61
+
62
+ # Returns true if response status is 2xx
63
+ #
64
+ # @return [Boolean] A boolean that binarizes the response status result.
64
65
  def success?
65
- (200..299).include?(code)
66
+ (200..299).include?(status)
66
67
  end
67
68
  end
68
69
  end
@@ -1,4 +1,4 @@
1
1
  # It's the version. Yeay!
2
2
  module Mailgun
3
- VERSION = '1.2.16'
3
+ VERSION = '1.3.1'
4
4
  end
data/lib/mailgun.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'tempfile'
2
- require 'rest_client'
2
+ require 'faraday'
3
3
  require 'yaml'
4
4
  require 'json'
5
5
 
data/mailgun.gemspec CHANGED
@@ -35,6 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency 'vcr', '~> 3.0.3'
36
36
  spec.add_development_dependency 'simplecov', '~> 0.16.1'
37
37
  spec.add_development_dependency 'rails'
38
- spec.add_dependency 'rest-client', '>= 2.0.2'
38
+ spec.add_dependency 'mime-types'
39
+ spec.add_dependency 'faraday', "~> 2.1"
39
40
 
40
41
  end
@@ -51,7 +51,7 @@ describe 'Client exceptions', vcr: vcr_opts do
51
51
  :text => 'INTEGRATION TESTING'
52
52
  })
53
53
  rescue Mailgun::Unauthorized => err
54
- expect(err.message).to eq('401 Unauthorized - Invalid Domain or API key: Forbidden')
54
+ expect(err.message).to eq('the server responded with status 401 - Invalid Domain or API key')
55
55
  else
56
56
  fail
57
57
  end
@@ -75,7 +75,7 @@ describe 'Client exceptions', vcr: vcr_opts do
75
75
  :text => 'INTEGRATION TESTING'
76
76
  })
77
77
  rescue Mailgun::BadRequest => err
78
- expect(err.message).to eq('400 Bad Request: to parameter is not a valid address. please check documentation')
78
+ expect(err.message).to eq('the server responded with status 400')
79
79
  else
80
80
  fail
81
81
  end
@@ -99,7 +99,7 @@ describe 'Client exceptions', vcr: vcr_opts do
99
99
  :text => 'INTEGRATION TESTING'
100
100
  })
101
101
  rescue Mailgun::CommunicationError => err
102
- expect(err.message).to include('403 Forbidden')
102
+ expect(err.message).to include('403')
103
103
  else
104
104
  fail
105
105
  end
@@ -192,7 +192,7 @@ Testing some Mailgun awesomness!'
192
192
  expect(result.body).to include("message")
193
193
  expect(result.body).to include("id")
194
194
  end
195
-
195
+
196
196
  it 'receives success response code' do
197
197
  @mg_obj.enable_test_mode!
198
198
 
@@ -205,7 +205,7 @@ Testing some Mailgun awesomness!'
205
205
 
206
206
  result = @mg_obj.send_message(@domain, data)
207
207
  result.to_h!
208
-
208
+
209
209
  expect(result.success?).to be(true)
210
210
  end
211
211
  end
@@ -99,7 +99,7 @@ module Mailgun
99
99
  return Response.from_hash({ body: JSON.generate({"message" => "Queued. Thank you.", "id" => id}) })
100
100
  end
101
101
  if resource_endpoint == "bounces"
102
- return Response.from_hash({ body: JSON.generate({"total_count" => 1, "items" => {"created_at" => "Fri, 21 Oct 2011 11:02:55 GMT", "code" => 550, "address" => "baz@example.com", "error" => "Message was not accepted -- invalid mailbox. Local mailbox baz@example.com is unavailable: user not found"}}) })
102
+ return Response.from_hash({ body: JSON.generate({"total_count" => 1, "items" => {"created_at" => "Fri, 21 Oct 2011 11:02:55 GMT", "status" => 550, "address" => "baz@example.com", "error" => "Message was not accepted -- invalid mailbox. Local mailbox baz@example.com is unavailable: user not found"}}) })
103
103
  end
104
104
  if resource_endpoint == "lists"
105
105
  return Response.from_hash({ body: JSON.generate({"member" => {"vars" => {"age" => 26}, "name" => "Foo Bar", "subscribed" => false, "address" => "bar@example.com"}, "message" => "Mailing list member has been updated"}) })
@@ -5,13 +5,13 @@ RSpec.describe Mailgun::CommunicationError do
5
5
  context "when the Response body doesn't have a `message` property" do
6
6
  it "doesn't raise an error" do
7
7
  expect do
8
- described_class.new('Boom!', Mailgun::Response.from_hash({ code: 401, body: '{}' }))
8
+ described_class.new('Boom!', Mailgun::Response.from_hash({ status: 401, body: '{}' }))
9
9
  end.not_to raise_error
10
10
  end
11
11
 
12
12
  context "when the Response body has an `Error` property" do
13
13
  it "uses the `Error` property as the API message" do
14
- subject = described_class.new('Boom!', Mailgun::Response.from_hash({ code: 401, body: '{"Error":"unauthorized"}' }))
14
+ subject = described_class.new('Boom!', Mailgun::Response.from_hash({ status: 401, body: '{"Error":"unauthorized"}' }))
15
15
 
16
16
  expect(subject.message).to eq("Boom!: unauthorized")
17
17
  end
@@ -19,7 +19,7 @@ RSpec.describe Mailgun::CommunicationError do
19
19
 
20
20
  context "when the Response body has an `error` property" do
21
21
  it "uses the `Error` property as the API message" do
22
- subject = described_class.new('Boom!', Mailgun::Response.from_hash({ code: 401, body: '{"error":"not found"}' }))
22
+ subject = described_class.new('Boom!', Mailgun::Response.from_hash({ status: 401, body: '{"error":"not found"}' }))
23
23
 
24
24
  expect(subject.message).to eq("Boom!: not found")
25
25
  end
@@ -172,4 +172,213 @@ http_interactions:
172
172
  address has been removed"}'
173
173
  http_version:
174
174
  recorded_at: Fri, 08 Jan 2016 20:33:30 GMT
175
- recorded_with: VCR 3.0.1
175
+ - request:
176
+ method: post
177
+ uri: https://api.mailgun.net/v3/DOMAIN.TEST/bounces
178
+ body:
179
+ encoding: UTF-8
180
+ string: address=integration-test%2Bemail%40DOMAIN.TEST&code=550&error=Integration+Test
181
+ headers:
182
+ User-Agent:
183
+ - mailgun-sdk-ruby/1.3.0
184
+ Accept:
185
+ - "*/*"
186
+ Authorization:
187
+ - Basic xxx==
188
+ Content-Type:
189
+ - application/x-www-form-urlencoded
190
+ Accept-Encoding:
191
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
192
+ response:
193
+ status:
194
+ code: 200
195
+ message: OK
196
+ headers:
197
+ Access-Control-Allow-Credentials:
198
+ - 'true'
199
+ Access-Control-Allow-Origin:
200
+ - "*"
201
+ Cache-Control:
202
+ - no-store
203
+ Content-Length:
204
+ - '145'
205
+ Content-Type:
206
+ - application/json; charset=utf-8
207
+ Date:
208
+ - Sun, 26 Jan 2025 07:29:04 GMT
209
+ Strict-Transport-Security:
210
+ - max-age=63072000; includeSubDomains
211
+ X-Mailgun-Key-Id:
212
+ - 90b59dea-f2d12a53
213
+ X-Request-Limit:
214
+ - '2500'
215
+ X-Request-Remaining:
216
+ - '2499'
217
+ X-Request-Reset:
218
+ - '1737876559178'
219
+ X-Xss-Protection:
220
+ - 1; mode=block
221
+ body:
222
+ encoding: UTF-8
223
+ string: '{"message":"Address has been added to the bounces table","address":"integration-test+email@DOMAIN.TEST"}
224
+
225
+ '
226
+ http_version:
227
+ recorded_at: Sun, 26 Jan 2025 07:29:04 GMT
228
+ - request:
229
+ method: get
230
+ uri: https://api.mailgun.net/v3/DOMAIN.TEST/bounces/integration-test+email@DOMAIN.TEST
231
+ body:
232
+ encoding: US-ASCII
233
+ string: ''
234
+ headers:
235
+ User-Agent:
236
+ - mailgun-sdk-ruby/1.3.0
237
+ Accept:
238
+ - "*/*"
239
+ Authorization:
240
+ - Basic xxx==
241
+ Accept-Encoding:
242
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
243
+ response:
244
+ status:
245
+ code: 200
246
+ message: OK
247
+ headers:
248
+ Access-Control-Allow-Credentials:
249
+ - 'true'
250
+ Access-Control-Allow-Origin:
251
+ - "*"
252
+ Cache-Control:
253
+ - no-store
254
+ Content-Length:
255
+ - '174'
256
+ Content-Type:
257
+ - application/json; charset=utf-8
258
+ Date:
259
+ - Sun, 26 Jan 2025 07:29:04 GMT
260
+ Strict-Transport-Security:
261
+ - max-age=63072000; includeSubDomains
262
+ X-Mailgun-Key-Id:
263
+ - 90b59dea-f2d12a53
264
+ X-Request-Limit:
265
+ - '2500'
266
+ X-Request-Remaining:
267
+ - '2498'
268
+ X-Request-Reset:
269
+ - '1737876559178'
270
+ X-Xss-Protection:
271
+ - 1; mode=block
272
+ body:
273
+ encoding: UTF-8
274
+ string: '{"address":"integration-test+email@DOMAIN.TEST","code":"550","error":"Integration
275
+ Test","created_at":"Sun, 26 Jan 2025 07:29:04 UTC"}
276
+
277
+ '
278
+ http_version:
279
+ recorded_at: Sun, 26 Jan 2025 07:29:04 GMT
280
+ - request:
281
+ method: get
282
+ uri: https://api.mailgun.net/v3/DOMAIN.TEST/bounces
283
+ body:
284
+ encoding: US-ASCII
285
+ string: ''
286
+ headers:
287
+ User-Agent:
288
+ - mailgun-sdk-ruby/1.3.0
289
+ Accept:
290
+ - "*/*"
291
+ Authorization:
292
+ - Basic xxx==
293
+ Accept-Encoding:
294
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
295
+ response:
296
+ status:
297
+ code: 200
298
+ message: OK
299
+ headers:
300
+ Access-Control-Allow-Credentials:
301
+ - 'true'
302
+ Access-Control-Allow-Origin:
303
+ - "*"
304
+ Cache-Control:
305
+ - no-store
306
+ Content-Length:
307
+ - '858'
308
+ Content-Type:
309
+ - application/json; charset=utf-8
310
+ Date:
311
+ - Sun, 26 Jan 2025 07:29:05 GMT
312
+ Strict-Transport-Security:
313
+ - max-age=63072000; includeSubDomains
314
+ X-Mailgun-Key-Id:
315
+ - 90b59dea-f2d12a53
316
+ X-Request-Limit:
317
+ - '2500'
318
+ X-Request-Remaining:
319
+ - '2497'
320
+ X-Request-Reset:
321
+ - '1737876559178'
322
+ X-Xss-Protection:
323
+ - 1; mode=block
324
+ body:
325
+ encoding: UTF-8
326
+ string: '{"items":[{"address":"integration-test+email@DOMAIN.TEST","code":"550","error":"Integration
327
+ Test","created_at":"Sun, 26 Jan 2025 07:29:04 UTC"}],"paging":{"first":"https://api.mailgun.net/v3/DOMAIN.TEST/bounces?limit=100&term=","last":"https://api.mailgun.net/v3/DOMAIN.TEST/bounces?page=last&limit=100&term=","next":"https://api.mailgun.net/v3/DOMAIN.TEST/bounces?page=next&address=integration-test%2Bemail%40DOMAIN.TEST&limit=100&term=","previous":"https://api.mailgun.net/v3/DOMAIN.TEST/bounces?page=previous&address=integration-test%2Bemail%40DOMAIN.TEST&limit=100&term="}}
328
+
329
+ '
330
+ http_version:
331
+ recorded_at: Sun, 26 Jan 2025 07:29:05 GMT
332
+ - request:
333
+ method: delete
334
+ uri: https://api.mailgun.net/v3/DOMAIN.TEST/bounces/integration-test+email@DOMAIN.TEST
335
+ body:
336
+ encoding: US-ASCII
337
+ string: ''
338
+ headers:
339
+ User-Agent:
340
+ - mailgun-sdk-ruby/1.3.0
341
+ Accept:
342
+ - "*/*"
343
+ Authorization:
344
+ - Basic xxx==
345
+ Accept-Encoding:
346
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
347
+ response:
348
+ status:
349
+ code: 200
350
+ message: OK
351
+ headers:
352
+ Access-Control-Allow-Credentials:
353
+ - 'true'
354
+ Access-Control-Allow-Origin:
355
+ - "*"
356
+ Cache-Control:
357
+ - no-store
358
+ Content-Length:
359
+ - '134'
360
+ Content-Type:
361
+ - application/json; charset=utf-8
362
+ Date:
363
+ - Sun, 26 Jan 2025 07:29:06 GMT
364
+ Strict-Transport-Security:
365
+ - max-age=63072000; includeSubDomains
366
+ X-Mailgun-Key-Id:
367
+ - 90b59dea-f2d12a53
368
+ X-Request-Limit:
369
+ - '2500'
370
+ X-Request-Remaining:
371
+ - '2496'
372
+ X-Request-Reset:
373
+ - '1737876559178'
374
+ X-Xss-Protection:
375
+ - 1; mode=block
376
+ body:
377
+ encoding: UTF-8
378
+ string: '{"address":"integration-test+email@DOMAIN.TEST","message":"Bounced
379
+ address has been removed"}
380
+
381
+ '
382
+ http_version:
383
+ recorded_at: Sun, 26 Jan 2025 07:29:06 GMT
384
+ recorded_with: VCR 3.0.3