trycourier 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/trycourier/accounts.rb +43 -0
- data/lib/trycourier/version.rb +1 -1
- data/lib/trycourier.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9f889e4d1a6af29bae1292ab1535becd744e29eabdea8d6ad127e925f294eea
|
4
|
+
data.tar.gz: d589261d6fc9615f820e9987e9703e0e71a390e4de1454845d0b6cd333b2f07d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67e6a4c7d7a097073d553aee2b60821ce57657b77d3c03925df530ef0a01758b5094cabea7735b5034e6e95032ad51714f5c050712a7bd7b5bc37c69b603dd79
|
7
|
+
data.tar.gz: 861b74171164d76b463ff8c7a3131e310d909547670ec8d9b6b3c1fffffa618e8481a2b9341d451d0199fc013aeabf25ae059444538e4038bfa0c49ae105dbae
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -0,0 +1,43 @@
|
|
1
|
+
module Courier
|
2
|
+
class Accounts
|
3
|
+
KEY = "/accounts"
|
4
|
+
|
5
|
+
def initialize(session)
|
6
|
+
@session = session
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_account(account_id:)
|
10
|
+
path = "#{KEY}/#{account_id}"
|
11
|
+
res = @session.send(path, "GET")
|
12
|
+
ErrorHandler.check_err(res)
|
13
|
+
end
|
14
|
+
|
15
|
+
def get_accounts(limit: nil, starting_after: nil)
|
16
|
+
params = {}
|
17
|
+
if limit
|
18
|
+
params["limit"] = limit
|
19
|
+
end
|
20
|
+
|
21
|
+
if starting_after
|
22
|
+
params["starting_after"] = starting_after
|
23
|
+
end
|
24
|
+
|
25
|
+
res = @session.send(KEY, "GET", params: params)
|
26
|
+
ErrorHandler.check_err(res)
|
27
|
+
end
|
28
|
+
|
29
|
+
def put_account(account_id:, account:)
|
30
|
+
path = "#{KEY}/#{account_id}"
|
31
|
+
|
32
|
+
res = @session.send(path, "PUT", body: account, headers: {})
|
33
|
+
ErrorHandler.check_err(res)
|
34
|
+
end
|
35
|
+
|
36
|
+
def delete_account(account_id:)
|
37
|
+
path = "#{KEY}/#{account_id}"
|
38
|
+
res = @session.send(path, "DELETE")
|
39
|
+
ErrorHandler.check_err_non_json(res)
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
data/lib/trycourier/version.rb
CHANGED
data/lib/trycourier.rb
CHANGED
@@ -8,6 +8,7 @@ require "trycourier/automations"
|
|
8
8
|
require "trycourier/bulk"
|
9
9
|
require "trycourier/audiences"
|
10
10
|
require "trycourier/audit_events"
|
11
|
+
require "trycourier/accounts"
|
11
12
|
require "trycourier/version"
|
12
13
|
require "trycourier/exceptions"
|
13
14
|
|
@@ -67,6 +68,7 @@ module Courier
|
|
67
68
|
@bulk = Courier::Bulk.new(@session)
|
68
69
|
@audiences = Courier::Audiences.new(@session)
|
69
70
|
@audit_events = Courier::AuditEvents.new(@session)
|
71
|
+
@accounts = Courier::Accounts.new(@session)
|
70
72
|
end
|
71
73
|
|
72
74
|
def send(body)
|
@@ -139,5 +141,7 @@ module Courier
|
|
139
141
|
|
140
142
|
attr_reader :audit_events
|
141
143
|
|
144
|
+
attr_reader :accounts
|
145
|
+
|
142
146
|
end
|
143
147
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trycourier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Courier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -61,6 +61,7 @@ files:
|
|
61
61
|
- bin/console
|
62
62
|
- bin/setup
|
63
63
|
- lib/trycourier.rb
|
64
|
+
- lib/trycourier/accounts.rb
|
64
65
|
- lib/trycourier/audiences.rb
|
65
66
|
- lib/trycourier/audit_events.rb
|
66
67
|
- lib/trycourier/automations.rb
|