pylon-api 1.1.1 → 1.2.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: 4f54f7ed75e823866e06256d1a598bb3158e686131156932b7aad3d9a90da9c7
4
- data.tar.gz: fe68e2c1be8128acadd4179b2baa2751fd9223fdbe1a5c66cb35d2d41c13fae0
3
+ metadata.gz: ae2b3657a71f50dfe1fbe13af8222fd19fb8026356543cae2b9372bb12bee3fa
4
+ data.tar.gz: 5232f1d4a792a6d06bf847ce5170bd4272166b7c47700f50929f676319dd0b88
5
5
  SHA512:
6
- metadata.gz: 6282c28251d01ed1f7c196fbb421c3e895d37681da8e71e5941ed74db3ff88aff39e8e9c8604fe899d555e61aec5bc7b8824fcdf30e6e789c3b74086d25ae7ee
7
- data.tar.gz: bf00a26818a96154c91a2a1f281d219372f0fd97b8b0075ddbb70fcebaa675c28b31e55a10bf218303fcc4e2b0ad15229a30950e2f2a5e41cd174995940c0a2a
6
+ metadata.gz: 1d87c185ffa7b4657a9daaa49e87aa1e03b17913c2c65601270f076165902b1689b7c1e02a0142bfb26a10c751507987547fc49658848104e965861d454ba5fc
7
+ data.tar.gz: 0fc12093a40563fbb376d6cd84dcf90dfdcd3e359702ab1f99cf750c1b458436a8ccd806d4d9089d42afaadeffeec1a36b25a3faaae290f4f32ee92145fc567e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.0] - 2026-09-20
4
+
5
+ ### Added
6
+ - `list_email_suppressions` for `GET /email-suppressions` with optional `email`, `cursor`, and `limit` query parameters. Pass `email` to check a single address; an empty collection means it is not suppressed.
7
+ - `delete_email_suppression` for `DELETE /email-suppressions/{id}`
8
+ - `Pylon::Models::EmailSuppression` model (`id`, `email`, `reason`, `created_at`, `bounce_details`)
9
+
10
+ ### Changed
11
+ - Documentation only: README examples now use `body_html` when creating issues and note the 365-day window for `list_issues`. No existing method signatures, paths, or return types changed.
12
+
3
13
  ## [1.1.1] - 2025-04-18
4
14
 
5
15
  ### Fixed
data/README.md CHANGED
@@ -55,25 +55,35 @@ account, response = client.get_account('account_id')
55
55
  #### Issues
56
56
 
57
57
  ```ruby
58
- # List issues (requires time range, max 30 days)
58
+ # List issues (requires time range, max 365 days)
59
59
  start_time = Time.now.utc - 86400 # 24 hours ago
60
60
  end_time = Time.now.utc
61
61
 
62
- issues, response = client.list_issues(
62
+ issues = client.list_issues(
63
63
  start_time: start_time.strftime("%Y-%m-%dT%H:%M:%SZ"),
64
64
  end_time: end_time.strftime("%Y-%m-%dT%H:%M:%SZ"),
65
65
  page: 1,
66
- per_page: 20,
67
- status: 'open' # optional filter
66
+ per_page: 20
68
67
  )
69
68
 
70
- # Create an issue
71
- issue, response = client.create_issue(
69
+ # Create an issue (title and body_html are required by the API)
70
+ issue = client.create_issue(
72
71
  title: 'New Issue',
73
- description: 'Issue description'
72
+ body_html: '<p>Issue description</p>',
73
+ requester_email: 'customer@example.com'
74
74
  )
75
75
  ```
76
76
 
77
+ #### Email Suppressions
78
+
79
+ ```ruby
80
+ # Check whether a single address is suppressed (empty collection means not suppressed)
81
+ suppressions = client.list_email_suppressions(email: 'user@example.com')
82
+
83
+ # Remove a suppression
84
+ client.delete_email_suppression(suppressions.first.id) unless suppressions.size.zero?
85
+ ```
86
+
77
87
  #### Teams
78
88
 
79
89
  ```ruby
data/lib/pylon/client.rb CHANGED
@@ -152,7 +152,30 @@ module Pylon
152
152
  post("/custom_fields", body: params)
153
153
  end
154
154
 
155
- # Lists issues within a specified time range (max 30 days)
155
+ # List email suppressions, most recently suppressed first
156
+ #
157
+ # Pass +email+ to check a single address. An empty collection means the
158
+ # address is not suppressed. Uses the API's cursor-based pagination.
159
+ #
160
+ # @param email [String, nil] Only return the suppression for this address, if one exists
161
+ # @param cursor [String, nil] Cursor for the next page of results
162
+ # @param limit [Integer, nil] Number of suppressions to fetch (API default 100, max 1000)
163
+ # @return [Models::Collection<Models::EmailSuppression>] Collection of email suppression objects
164
+ def list_email_suppressions(email: nil, cursor: nil, limit: nil)
165
+ query = { email: email, cursor: cursor, limit: limit }.compact
166
+ get("/email-suppressions", query: query,
167
+ model_class: Models::EmailSuppression, collection: true)
168
+ end
169
+
170
+ # Remove an email suppression so Pylon resumes sending to the address
171
+ #
172
+ # @param suppression_id [String] The ID of the email suppression to remove
173
+ # @return [Array(Hash, Faraday::Response)] Response data and raw response
174
+ def delete_email_suppression(suppression_id)
175
+ delete("/email-suppressions/#{suppression_id}")
176
+ end
177
+
178
+ # Lists issues within a specified time range (max 365 days)
156
179
  #
157
180
  # @param start_time [String] Start time in RFC3339 format
158
181
  # @param end_time [String] End time in RFC3339 format
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pylon
4
+ module Models
5
+ # An email address Pylon will not send to, either because a message
6
+ # hard bounced or because someone suppressed it manually.
7
+ #
8
+ # Attributes: id, email, reason ("hard_bounce" or "manual"),
9
+ # created_at (RFC3339), bounce_details
10
+ class EmailSuppression < Base
11
+ end
12
+ end
13
+ end
data/lib/pylon/version.rb CHANGED
@@ -4,9 +4,9 @@ module Pylon
4
4
  # Major version for breaking changes
5
5
  MAJOR = 1
6
6
  # Minor version for new features
7
- MINOR = 1
7
+ MINOR = 2
8
8
  # Patch version for bug fixes
9
- PATCH = 1
9
+ PATCH = 0
10
10
  # Pre-release version (optional)
11
11
  PRE = nil
12
12
 
data/lib/pylon.rb CHANGED
@@ -17,6 +17,7 @@ require_relative "pylon/models/attachment"
17
17
  require_relative "pylon/models/contact"
18
18
  require_relative "pylon/models/ticket_form"
19
19
  require_relative "pylon/models/article"
20
+ require_relative "pylon/models/email_suppression"
20
21
  require_relative "pylon/client"
21
22
 
22
23
  module Pylon
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pylon-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Odom
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-18 00:00:00.000000000 Z
11
+ date: 2026-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -140,6 +140,7 @@ files:
140
140
  - lib/pylon/models/base.rb
141
141
  - lib/pylon/models/collection.rb
142
142
  - lib/pylon/models/contact.rb
143
+ - lib/pylon/models/email_suppression.rb
143
144
  - lib/pylon/models/issue.rb
144
145
  - lib/pylon/models/tag.rb
145
146
  - lib/pylon/models/team.rb