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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b109ca392cd8dc7760b016a016c6014cdda3aa46e86443e23f89b302e14d547e
4
- data.tar.gz: e4aaccf736dd71f8903bd477b10aacce0d2f341254004edcd023679797be7aed
3
+ metadata.gz: f9f889e4d1a6af29bae1292ab1535becd744e29eabdea8d6ad127e925f294eea
4
+ data.tar.gz: d589261d6fc9615f820e9987e9703e0e71a390e4de1454845d0b6cd333b2f07d
5
5
  SHA512:
6
- metadata.gz: ac34939a4b50cb50b6df3650934fc8143b440add045aaf046ffb8044ce9ab3e867d322e06bcb1b1d7b5004470068c7efd4430e2e7cb732a2b2f6f917eaecbc12
7
- data.tar.gz: 6b9dbd28970b57e097cc6d26f6d2eaa07c3fbc1b2160737ae3dbd2bc2aff70e2e547ad2c37744eba76e44bad54d01bfc2b3dcb09eedd5972034c45371a21cbec
6
+ metadata.gz: 67e6a4c7d7a097073d553aee2b60821ce57657b77d3c03925df530ef0a01758b5094cabea7735b5034e6e95032ad51714f5c050712a7bd7b5bc37c69b603dd79
7
+ data.tar.gz: 861b74171164d76b463ff8c7a3131e310d909547670ec8d9b6b3c1fffffa618e8481a2b9341d451d0199fc013aeabf25ae059444538e4038bfa0c49ae105dbae
data/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased][unreleased]
7
7
 
8
+ ## [v1.8.0] - 2023-07-24
9
+
10
+ - Support for Accounts API
11
+
8
12
  ## [v1.7.0] - 2023-06-22
9
13
 
10
14
  - 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.8.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, 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
@@ -1,3 +1,3 @@
1
1
  module Courier
2
- VERSION = "1.7.0"
2
+ VERSION = "1.8.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.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-06-26 00:00:00.000000000 Z
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