sendly 3.34.0 → 3.35.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: 71c3ad356b4aa2903e05f1f174ce9a70f1fb1fe5cc4b0748ae69db333a0c25ac
4
- data.tar.gz: 86df6410241d17dc84854057d19b2b13e6f32f504bf87243e276ec9260f78a34
3
+ metadata.gz: '09a32581d4ce1256ffd2bf348216cf42877665720fd31f7eab4ff50ba9eb30be'
4
+ data.tar.gz: f713cd2607feeeab90f997a66580d888c2da4bc7b6cf427c4fd77b27dadd866b
5
5
  SHA512:
6
- metadata.gz: 385c9b3f1973a51b923fed18d0b23a128c060d0d122ed782e08f3a21c1477ece2caca8aaeba65c71c8c494946630ffe21e9ac12eade63530ea207de10dfa0661
7
- data.tar.gz: 6e274e7b40280d52118812b61ffa31b936d912baa0147027a448c7156d110ed24e4c3c0ba70f2a589bae3d0b3531316761a80fe2864fa821415002e0d3741f01
6
+ metadata.gz: 4c0e5cf78135e5e1571d724084aeb850928fdf96fb1bdb9ada800835574816ea54b5bb5cca17298c3aac26d456b0704cce9a3a177e797f800af65c538533a5ff
7
+ data.tar.gz: 9ad05417089aeb02dff49dc4e33a66484cf6cc1ffd03aefa35e21b7d7b7d9745de7bc7ddbcf2330bc7d57a625e208c0778ce37fe0efd410536391fe2ef178d71
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sendly (3.34.0)
4
+ sendly (3.35.0)
5
5
  faraday (~> 2.0)
6
6
  faraday-retry (~> 2.0)
7
7
 
@@ -14,6 +14,7 @@ module Sendly
14
14
  #
15
15
  # @param to [String] Recipient phone number in E.164 format
16
16
  # @param text [String] Message content (max 1600 characters)
17
+ # @param from [String] Sender ID or phone number (optional)
17
18
  # @param message_type [String] Message type: "marketing" (default) or "transactional"
18
19
  # @param metadata [Hash] Custom JSON metadata to attach to the message (max 4KB)
19
20
  # @return [Sendly::Message] The sent message
@@ -36,11 +37,12 @@ module Sendly
36
37
  # text: "Your verification code is 123456",
37
38
  # message_type: "transactional"
38
39
  # )
39
- def send(to:, text:, message_type: nil, metadata: nil, media_urls: nil)
40
+ def send(to:, text:, from: nil, message_type: nil, metadata: nil, media_urls: nil)
40
41
  validate_phone!(to)
41
42
  validate_text!(text)
42
43
 
43
44
  body = { to: to, text: text }
45
+ body[:from] = from if from
44
46
  body[:messageType] = message_type if message_type
45
47
  body[:metadata] = metadata if metadata
46
48
  body[:mediaUrls] = media_urls if media_urls
@@ -42,7 +42,14 @@ module Sendly
42
42
  # A number owned by the account.
43
43
  class PhoneNumber
44
44
  attr_reader :id, :phone_number, :status, :source, :country_code,
45
- :phone_number_type, :monthly_cost_cents
45
+ :phone_number_type, :monthly_cost_cents,
46
+ # ISO-8601 timestamp string, or nil when the number still needs
47
+ # regulatory documents (a value means docs are under carrier review).
48
+ :requirements_submitted_at,
49
+ # true when the number is scheduled for release at period end.
50
+ :pending_cancellation,
51
+ # ISO-8601 timestamp string, or nil when no release is scheduled.
52
+ :scheduled_release_at
46
53
 
47
54
  def initialize(data)
48
55
  @id = data["id"]
@@ -52,13 +59,19 @@ module Sendly
52
59
  @country_code = data["countryCode"] || data["country_code"]
53
60
  @phone_number_type = data["phoneNumberType"] || data["phone_number_type"]
54
61
  @monthly_cost_cents = data["monthlyCostCents"] || data["monthly_cost_cents"]
62
+ @requirements_submitted_at = data["requirementsSubmittedAt"] || data["requirements_submitted_at"]
63
+ @pending_cancellation = data.key?("pendingCancellation") ? data["pendingCancellation"] : data["pending_cancellation"]
64
+ @scheduled_release_at = data["scheduledReleaseAt"] || data["scheduled_release_at"]
55
65
  end
56
66
 
57
67
  def to_h
58
68
  {
59
69
  id: id, phone_number: phone_number, status: status, source: source,
60
70
  country_code: country_code, phone_number_type: phone_number_type,
61
- monthly_cost_cents: monthly_cost_cents
71
+ monthly_cost_cents: monthly_cost_cents,
72
+ requirements_submitted_at: requirements_submitted_at,
73
+ pending_cancellation: pending_cancellation,
74
+ scheduled_release_at: scheduled_release_at
62
75
  }.compact
63
76
  end
64
77
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sendly
4
- VERSION = "3.34.0"
4
+ VERSION = "3.35.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendly
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.34.0
4
+ version: 3.35.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sendly
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-06-03 00:00:00.000000000 Z
11
+ date: 2026-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday