recurly 4.12.0 → 4.13.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: '0876e485b804ec79b1a15203f09ffe4ee5d209775aa21b2c720d6fbf23b0aeb3'
4
- data.tar.gz: 7cc1dc915610febad9e7fffe2617efdaa6ab27ed01cbac429765d1bbcf32df7a
3
+ metadata.gz: 74bb3fffd3b52c40e084beb12012c90e60fdf1e77ffa7de109a33c1a7e10d8cf
4
+ data.tar.gz: e59f0c7a4b633b001ff1bb2329825ef23611739f73e0313a0dfdd207e02492d4
5
5
  SHA512:
6
- metadata.gz: 4b513a3e05b7b7d01588900fe8ffeef0c01d6b10e95fa8dd3c0738e9786705cdcbffe4c1e8604983de8b4fc5e17fd884e24e5b12dc2cdf407ceacd6119f165fa
7
- data.tar.gz: 5c0e860427fa02b6fbb4f31afe6d7ddee1bc842af631a380e85cde67a7d0dfa4ba3bc9a983b310d6060d32198f530d8a8bc706240ea33bda7ae11f9144bdcc44
6
+ metadata.gz: c6d9e98a5f1c647ccefabb42985ecc0877ee6186f9130af118f17473380f02872228a7be1857958faaee06e8031295adc66de7fdf85f0140068aa62944017888
7
+ data.tar.gz: 288ed5f243fb25d4c115fd1162d3e8e883b67cf90fdce2d5fb480e37429f8d4ed72bec8000f8a3c1533bc91fe5f5ed2e92b19dffe6f5bbefd524622e1aa635e4
data/.bumpversion.cfg CHANGED
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 4.12.0
2
+ current_version = 4.13.0
3
3
  parse = (?P<major>\d+)
4
4
  \.(?P<minor>\d+)
5
5
  \.(?P<patch>\d+)
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.13.0](https://github.com/recurly/recurly-client-ruby/tree/4.13.0) (2022-01-31)
4
+
5
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.12.0...4.13.0)
6
+
7
+
8
+ **Merged Pull Requests**
9
+
10
+ - Generated Latest Changes for v2021-02-25 [#747](https://github.com/recurly/recurly-client-ruby/pull/747) ([recurly-integrations](https://github.com/recurly-integrations))
11
+ - Add region argument to client to connect in EU data center [#744](https://github.com/recurly/recurly-client-ruby/pull/744) ([FabricioCoutinho](https://github.com/FabricioCoutinho))
12
+
13
+
14
+
3
15
  ## [4.12.0](https://github.com/recurly/recurly-client-ruby/tree/4.12.0) (2022-01-28)
4
16
 
5
17
  [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.11.0...4.12.0)
data/GETTING_STARTED.md CHANGED
@@ -5,7 +5,7 @@ This repository houses the official ruby client for Recurly's V3 API.
5
5
  In your Gemfile, add `recurly` as a dependency.
6
6
 
7
7
  ```ruby
8
- gem 'recurly', '~> 4.12'
8
+ gem 'recurly', '~> 4.13'
9
9
  ```
10
10
 
11
11
  > *Note*: We try to follow [semantic versioning](https://semver.org/) and will only apply breaking changes to major versions.
@@ -22,6 +22,14 @@ client = Recurly::Client.new(api_key: API_KEY)
22
22
  sub = client.get_subscription(subscription_id: 'abcd123456')
23
23
  ```
24
24
 
25
+ To access Recurly API in Europe, you will need to specify the EU Region in the argument region.
26
+
27
+ ```ruby
28
+ API_KEY = '83749879bbde395b5fe0cc1a5abf8e5'
29
+ client = Recurly::Client.new(api_key: API_KEY, region: :eu)
30
+ sub = client.get_subscription(subscription_id: 'abcd123456')
31
+ ```
32
+
25
33
  You can also pass the initializer a block. This will give you a client scoped for just that block:
26
34
 
27
35
  ```ruby
@@ -11,7 +11,11 @@ module Recurly
11
11
  class Client
12
12
  require_relative "./client/operations"
13
13
 
14
- BASE_URL = "https://v3.recurly.com"
14
+ API_HOSTS = {
15
+ us: "https://v3.recurly.com",
16
+ eu: "https://v3.eu.recurly.com",
17
+ }
18
+ REGION = :us
15
19
  CA_FILE = File.join(File.dirname(__FILE__), "../data/ca-certificates.crt")
16
20
  BINARY_TYPES = [
17
21
  "application/pdf",
@@ -52,13 +56,18 @@ module Recurly
52
56
  # client = Recurly::Client.new(api_key: API_KEY2)
53
57
  # sub = client.get_subscription(subscription_id: 'uuid-abcd7890')
54
58
  #
59
+ # @param region [String] The DataCenter that is called by the API. Default to "us"
55
60
  # @param base_url [String] The base URL for the API. Defaults to "https://v3.recurly.com"
56
61
  # @param ca_file [String] The CA bundle to use when connecting to the API. Defaults to "data/ca-certificates.crt"
57
62
  # @param api_key [String] The private API key
58
63
  # @param logger [Logger] A logger to use. Defaults to creating a new STDOUT logger with level WARN.
59
- def initialize(base_url: BASE_URL, ca_file: CA_FILE, api_key:, logger: nil)
64
+ def initialize(region: REGION, base_url: API_HOSTS[:us], ca_file: CA_FILE, api_key:, logger: nil)
60
65
  raise ArgumentError, "'api_key' must be set to a non-nil value" if api_key.nil?
61
66
 
67
+ raise ArgumentError, "Invalid region type. Expected one of: #{API_HOSTS.keys.join(", ")}" if !API_HOSTS.key?(region)
68
+
69
+ base_url = API_HOSTS[region] if base_url == API_HOSTS[:us] && API_HOSTS.key?(region)
70
+
62
71
  set_api_key(api_key)
63
72
  set_connection_options(base_url, ca_file)
64
73
 
@@ -110,7 +119,9 @@ module Recurly
110
119
 
111
120
  def get(path, **options)
112
121
  validate_options!(**options)
122
+
113
123
  request = Net::HTTP::Get.new build_url(path, options)
124
+
114
125
  set_headers(request, options[:headers])
115
126
  http_response = run_request(request, options)
116
127
  handle_response! request, http_response
@@ -168,6 +179,7 @@ module Recurly
168
179
 
169
180
  begin
170
181
  http.start unless http.started?
182
+
171
183
  log_attrs = {
172
184
  method: request.method,
173
185
  path: request.path,
@@ -29,6 +29,8 @@ module Recurly
29
29
 
30
30
  class ServiceNotAvailableError < InternalServerError; end
31
31
 
32
+ class TaxServiceError < InternalServerError; end
33
+
32
34
  class BadGatewayError < ServerError; end
33
35
 
34
36
  class ServiceUnavailableError < ServerError; end
@@ -1,3 +1,3 @@
1
1
  module Recurly
2
- VERSION = "4.12.0"
2
+ VERSION = "4.13.0"
3
3
  end
data/openapi/api.yaml CHANGED
@@ -22001,6 +22001,7 @@ components:
22001
22001
  - rate_limited
22002
22002
  - service_not_available
22003
22003
  - simultaneous_request
22004
+ - tax_service_error
22004
22005
  - transaction
22005
22006
  - unauthorized
22006
22007
  - unavailable_in_api_version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recurly
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.0
4
+ version: 4.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-28 00:00:00.000000000 Z
11
+ date: 2022-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -303,7 +303,7 @@ metadata:
303
303
  changelog_uri: https://github.com/recurly/recurly-client-ruby/blob/master/CHANGELOG.md
304
304
  documentation_uri: https://recurly.github.io/recurly-client-ruby/
305
305
  homepage_uri: https://github.com/recurly/recurly-client-ruby
306
- source_code_uri: https://github.com/recurly/recurly-client-ruby/tree/4.12.0
306
+ source_code_uri: https://github.com/recurly/recurly-client-ruby/tree/4.13.0
307
307
  post_install_message:
308
308
  rdoc_options: []
309
309
  require_paths: