resend 0.17.2 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af2645da5d602105cd60b47747972b1fa8de2d24623a8b2632f3d218f91842ca
4
- data.tar.gz: 1b903aab1f8868d1b29611e71a02f4a081f0921690b8d5091f0463fb631a6b21
3
+ metadata.gz: 81c1365c2d9349d09a02ef4794693b7af091032572096308d9f0fd26b49f4cc0
4
+ data.tar.gz: 665e7731c7fc7e8a2dde7c2d9dac410411f98aa3875cb3fa7ba4482b1fa8ff9c
5
5
  SHA512:
6
- metadata.gz: dc0183b4adc0123f612f41df6dd71a0a9e8faebae93feb82beb4a6545a8b3866acc578078d70c49157397215e1c40d4dfc480f5639e2101ae600972aa2012024
7
- data.tar.gz: 669e1db9676210717c02f7508a7f0f67fbe225f2fec238827b53903ddb8117c7f6b41a92bc64681fb1c955ee128bcbc348233f703ca950507454f1df86858562
6
+ metadata.gz: ba0ff3dfdabfc35154b7c54a259eae9e2f34a053f327c940bcc13844995aa56d1a654605656f5a56b6732f543a238b207522636932e4fb4a707933065925740b
7
+ data.tar.gz: fc8240192183768510aff96e175c5c1fd329dfe23d5b6623b7e89529e1fafe6c6d2726335b34d81d13e275b2c6bcd38b27d0a65a98f891c808b6cede2bf0c0ec
@@ -19,6 +19,10 @@ module Resend
19
19
  Resend::Request.new(path, {}, "get").perform
20
20
  end
21
21
 
22
+ #
23
+ # List contacts in an audience
24
+ #
25
+ # @param audience_id [String] the audience id
22
26
  # https://resend.com/docs/api-reference/contacts/list-contacts
23
27
  def list(audience_id)
24
28
  path = "audiences/#{audience_id}/contacts"
@@ -37,9 +41,15 @@ module Resend
37
41
  Resend::Request.new(path, {}, "delete").perform
38
42
  end
39
43
 
44
+ #
45
+ # Update a contact
46
+ #
47
+ # @param params [Hash] the contact params
40
48
  # https://resend.com/docs/api-reference/contacts/update-contact
41
49
  def update(params)
42
- path = "audiences/#{params[:audience_id]}/contacts/#{params[:id]}"
50
+ raise ArgumentError, "id or email is required" if params[:id].nil? && params[:email].nil?
51
+
52
+ path = "audiences/#{params[:audience_id]}/contacts/#{params[:id] || params[:email]}"
43
53
  Resend::Request.new(path, params, "patch").perform
44
54
  end
45
55
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Resend
4
- VERSION = "0.17.2"
4
+ VERSION = "0.18.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.2
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derich Pacheco
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-16 00:00:00.000000000 Z
11
+ date: 2025-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty