sendly 3.18.2 → 3.19.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/lib/sendly/client.rb +8 -1
- data/lib/sendly/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9258e29e863797fbc0b0fd1b9bb284aa96bb5c62ae3bda82975569ca300aa283
|
|
4
|
+
data.tar.gz: 832f2ea2e2ad204d5430ff67159a54d1add7b611556d59647193f70eb06536a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5a19a1b90bc8241474c5e9b98013384b4c326db89ffc0ecaafe1519f78b112451e1a598ab42a03c7e1eeaa45b3ed829bb4ad940888526245be2bcc895cada3a
|
|
7
|
+
data.tar.gz: 83c2d120131cd432a07877215cf90dc824abb60e0d28feda878e103705ab762c5f8036ad9f5997978509d3621088eb8f37802e77cd27ad773b649ff98f7a1f9c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -387,14 +387,14 @@ result = client.enterprise.provision(
|
|
|
387
387
|
name: "Acme Insurance - Austin",
|
|
388
388
|
source_workspace_id: "ws_verified",
|
|
389
389
|
credit_amount: 5000,
|
|
390
|
-
credit_source_workspace_id: "
|
|
390
|
+
credit_source_workspace_id: "SOURCE_WORKSPACE_ID",
|
|
391
391
|
key_name: "Production",
|
|
392
392
|
key_type: "live",
|
|
393
393
|
generate_opt_in_page: true
|
|
394
394
|
)
|
|
395
395
|
|
|
396
396
|
puts result["workspace"]["id"]
|
|
397
|
-
puts result["
|
|
397
|
+
puts result["key"]["key"]
|
|
398
398
|
```
|
|
399
399
|
|
|
400
400
|
Three provisioning modes:
|
|
@@ -422,7 +422,7 @@ client.enterprise.workspaces.transfer_credits("ws_dest",
|
|
|
422
422
|
|
|
423
423
|
key = client.enterprise.workspaces.create_key("ws_xxx",
|
|
424
424
|
name: "Production", type: "live")
|
|
425
|
-
puts key["
|
|
425
|
+
puts key["key"]
|
|
426
426
|
|
|
427
427
|
client.enterprise.workspaces.revoke_key("ws_xxx", "key_abc")
|
|
428
428
|
```
|
data/lib/sendly/client.rb
CHANGED
|
@@ -20,21 +20,26 @@ module Sendly
|
|
|
20
20
|
# @return [Integer] Maximum retry attempts
|
|
21
21
|
attr_reader :max_retries
|
|
22
22
|
|
|
23
|
+
# @return [String, nil] Organization ID
|
|
24
|
+
attr_accessor :organization_id
|
|
25
|
+
|
|
23
26
|
# Create a new Sendly client
|
|
24
27
|
#
|
|
25
28
|
# @param api_key [String] Your Sendly API key
|
|
26
29
|
# @param base_url [String] API base URL (optional)
|
|
27
30
|
# @param timeout [Integer] Request timeout in seconds (default: 30)
|
|
28
31
|
# @param max_retries [Integer] Maximum retry attempts (default: 3)
|
|
32
|
+
# @param organization_id [String, nil] Organization ID (optional)
|
|
29
33
|
#
|
|
30
34
|
# @example
|
|
31
35
|
# client = Sendly::Client.new("sk_live_v1_xxx")
|
|
32
36
|
# client = Sendly::Client.new("sk_live_v1_xxx", timeout: 60, max_retries: 5)
|
|
33
|
-
def initialize(api_key:, base_url: nil, timeout: 30, max_retries: 3)
|
|
37
|
+
def initialize(api_key:, base_url: nil, timeout: 30, max_retries: 3, organization_id: nil)
|
|
34
38
|
@api_key = api_key
|
|
35
39
|
@base_url = (base_url || Sendly.base_url).chomp("/")
|
|
36
40
|
@timeout = timeout
|
|
37
41
|
@max_retries = max_retries
|
|
42
|
+
@organization_id = organization_id || ENV["SENDLY_ORG_ID"]
|
|
38
43
|
|
|
39
44
|
validate_api_key!
|
|
40
45
|
end
|
|
@@ -173,6 +178,7 @@ module Sendly
|
|
|
173
178
|
req["Accept"] = "application/json"
|
|
174
179
|
req["User-Agent"] = "sendly-ruby/#{VERSION}"
|
|
175
180
|
req["Content-Type"] = "multipart/form-data; boundary=#{boundary}"
|
|
181
|
+
req["X-Organization-Id"] = @organization_id if @organization_id
|
|
176
182
|
req.body = body.join
|
|
177
183
|
|
|
178
184
|
attempt = 0
|
|
@@ -280,6 +286,7 @@ module Sendly
|
|
|
280
286
|
req["Content-Type"] = "application/json"
|
|
281
287
|
req["Accept"] = "application/json"
|
|
282
288
|
req["User-Agent"] = "sendly-ruby/#{VERSION}"
|
|
289
|
+
req["X-Organization-Id"] = @organization_id if @organization_id
|
|
283
290
|
|
|
284
291
|
req.body = body.to_json if body
|
|
285
292
|
|
data/lib/sendly/version.rb
CHANGED
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.
|
|
4
|
+
version: 3.19.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sendly
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-03-
|
|
11
|
+
date: 2026-03-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|