api_six_client 1.4.3 → 1.4.5

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: 453b0502a583fe7185a5954f634c9fda27f36c9a675d27dbce1bb4e8a718235b
4
- data.tar.gz: 725e6182d895564c5700cd0462beb25e46676e7fa9eb11e2a4ceea0559a27eb2
3
+ metadata.gz: 6b4c5436c7806404e8ad5f25a8746065e2071886bd841598325bf5f1728d4a3c
4
+ data.tar.gz: '063028f67d0e712ec808ff9b2b87943a4db8af889e7bebd6a3b5fea409cea80f'
5
5
  SHA512:
6
- metadata.gz: 2477d8d7645bd64f0eacc1c674feefd64cee4f42df82b822733f4746a0ae7e79454d1b48a8875e50e17cac7414b5b8aafa54385f2862caa4d1c2ebd45f501f5b
7
- data.tar.gz: fcf2d0f9a7c6200fb7f3a65c7105faff009065e5d37733eb15ec2e20e33615db9ccde3445aabc2ed48c43e6151cca85532b337cfea97f755e90c015dfed31e9c
6
+ metadata.gz: 4c8a6c4cd94202197ef126c7b27876474bab8fe706447bab1ed5d3dead71823a2c0eda0c58ca62d12970890df4ee6e043b6c5b68fbd70646568e7c3201bb7e70
7
+ data.tar.gz: c1c2c46194ae62ec587258c789434ba02628d5f1bd5df9d7e7905e0b27fb2d3db87801358ea849a7b0b47bf60b9de68116712f71237314b1e514f8d212a50fa4
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- api_six_client (1.4.3)
4
+ api_six_client (1.4.5)
5
5
  faraday (~> 2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- faraday (2.7.6)
10
+ faraday (2.7.10)
11
11
  faraday-net_http (>= 2.0, < 3.1)
12
12
  ruby2_keywords (>= 0.0.4)
13
13
  faraday-net_http (3.0.2)
@@ -7,12 +7,13 @@ module ApiSixClient
7
7
  class Base
8
8
  attr_reader :endpoint
9
9
 
10
- def initialize(endpoint: nil, auth_token: nil)
11
- @endpoint = endpoint || ApiSixClient.config.endpoint
12
- @auth_token = auth_token || ApiSixClient.config.auth_token
10
+ def initialize(endpoint: nil, auth_token: nil, debug_mode: false)
11
+ @endpoint = endpoint
12
+ @auth_token = auth_token
13
+ @debug_mode = debug_mode
13
14
 
14
- raise Errors::EndpointIsEmpty unless @endpoint
15
- raise Errors::AuthTokenIsEmpty unless @auth_token
15
+ override_defaults
16
+ validate_config!
16
17
  end
17
18
 
18
19
  def post(path, params = {}, headers = {})
@@ -35,8 +36,20 @@ module ApiSixClient
35
36
  request __method__, path, params, headers
36
37
  end
37
38
 
39
+ protected
40
+
41
+ def override_defaults
42
+ @endpoint ||= ApiSixClient.config.endpoint_int
43
+ @auth_token ||= ApiSixClient.config.auth_token_int
44
+ end
45
+
38
46
  private
39
47
 
48
+ def validate_config!
49
+ raise Errors::EndpointIsEmpty unless @endpoint
50
+ raise Errors::AuthTokenIsEmpty unless @auth_token
51
+ end
52
+
40
53
  def service_path
41
54
  self.class.name.demodulize.underscore
42
55
  end
@@ -61,6 +74,8 @@ module ApiSixClient
61
74
 
62
75
  faraday.request :url_encoded
63
76
  faraday.adapter :net_http
77
+
78
+ faraday.response :logger, ::Logger.new(STDOUT), bodies: true if @debug_mode
64
79
  end
65
80
  end
66
81
  end
@@ -2,12 +2,11 @@
2
2
 
3
3
  module ApiSixClient
4
4
  class BaseInt < Base
5
- def initialize(endpoint: nil, auth_token: nil)
5
+ protected
6
+
7
+ def override_defaults
6
8
  @endpoint = ApiSixClient.config.endpoint_int
7
9
  @auth_token = ApiSixClient.config.auth_token_int
8
-
9
- raise Errors::EndpointIsEmpty unless @endpoint
10
- raise Errors::AuthTokenIsEmpty unless @auth_token
11
10
  end
12
11
  end
13
12
  end
@@ -2,12 +2,11 @@
2
2
 
3
3
  module ApiSixClient
4
4
  class BaseV2 < Base
5
- def initialize(endpoint: nil, auth_token: nil)
5
+ protected
6
+
7
+ def override_defaults
6
8
  @endpoint = ApiSixClient.config.endpoint_v2
7
9
  @auth_token = ApiSixClient.config.auth_token_v2
8
-
9
- raise Errors::EndpointIsEmpty unless @endpoint
10
- raise Errors::AuthTokenIsEmpty unless @auth_token
11
10
  end
12
11
  end
13
12
  end
@@ -2,12 +2,11 @@
2
2
 
3
3
  module ApiSixClient
4
4
  class BaseV2Int < Base
5
- def initialize(endpoint: nil, auth_token: nil)
5
+ protected
6
+
7
+ def override_defaults
6
8
  @endpoint = ApiSixClient.config.endpoint_v2_int
7
9
  @auth_token = ApiSixClient.config.auth_token_v2_int
8
-
9
- raise Errors::EndpointIsEmpty unless @endpoint
10
- raise Errors::AuthTokenIsEmpty unless @auth_token
11
10
  end
12
11
  end
13
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApiSixClient
4
- VERSION = "1.4.3"
4
+ VERSION = "1.4.5"
5
5
  end
@@ -36,4 +36,7 @@ module ApiSixClient
36
36
 
37
37
  class AuthInt < BaseV2Int; end
38
38
  class UasInt < BaseV2Int; end
39
+ class NtfInt < BaseV2Int; end
39
40
  end
41
+
42
+ A6C = ApiSixClient
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_six_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eugene Dobrorodnov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-08 00:00:00.000000000 Z
11
+ date: 2023-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday