trycourier 1.7.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b109ca392cd8dc7760b016a016c6014cdda3aa46e86443e23f89b302e14d547e
4
- data.tar.gz: e4aaccf736dd71f8903bd477b10aacce0d2f341254004edcd023679797be7aed
3
+ metadata.gz: 0fe5b54e08b1376178ef2318cfb1e96e0fe0d428fcc38ff40773506cadbb4098
4
+ data.tar.gz: 657fa9076d6a2fa31c366b24e3c4633237bd99ea535ee903b22de3d4028fcd4b
5
5
  SHA512:
6
- metadata.gz: ac34939a4b50cb50b6df3650934fc8143b440add045aaf046ffb8044ce9ab3e867d322e06bcb1b1d7b5004470068c7efd4430e2e7cb732a2b2f6f917eaecbc12
7
- data.tar.gz: 6b9dbd28970b57e097cc6d26f6d2eaa07c3fbc1b2160737ae3dbd2bc2aff70e2e547ad2c37744eba76e44bad54d01bfc2b3dcb09eedd5972034c45371a21cbec
6
+ metadata.gz: e085fc93ceb2d9654f308ba292b69891f49e183dcfa7a514387a638a2277033a797a60a8b5fd045697d6db5059ed3e8a4315da21c53a98fcd236aeacbd10571c
7
+ data.tar.gz: 80f44b367ae7019789a0a49fc9a05cdda8e06bf6c70400a30171b80b5472ca6292c10333c367c446d5c75860146876a943c61c1d85bb5caeed8a9207f422f95c
data/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased][unreleased]
7
7
 
8
+ ## [v1.9.0] - 2023-07-31
9
+
10
+ - Add pagination attributes for accounts API
11
+
12
+ ## [v1.8.0] - 2023-07-24
13
+
14
+ - Support for Accounts API
15
+
8
16
  ## [v1.7.0] - 2023-06-22
9
17
 
10
18
  - Support for cancel message API
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trycourier (1.7.0)
4
+ trycourier (1.9.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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, cursor: nil)
16
+ params = {}
17
+ if limit
18
+ params["limit"] = limit
19
+ end
20
+
21
+ if cursor
22
+ params["cursor"] = cursor
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
@@ -1,3 +1,3 @@
1
1
  module Courier
2
- VERSION = "1.7.0"
2
+ VERSION = "1.9.0"
3
3
  end
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.7.0
4
+ version: 1.9.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-06-26 00:00:00.000000000 Z
11
+ date: 2023-07-31 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