api_six_client 1.4.3 → 1.4.4

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: 453b0502a583fe7185a5954f634c9fda27f36c9a675d27dbce1bb4e8a718235b
4
- data.tar.gz: 725e6182d895564c5700cd0462beb25e46676e7fa9eb11e2a4ceea0559a27eb2
3
+ metadata.gz: c8489c55dbd23fe027439ff87773f8671c306c5ffde70a2e32bd64ca6bbda017
4
+ data.tar.gz: 5ef40b78d82414ebb57239cef2ffc7dc09e3d4dc7ddfc57c0fc2722f4ecff9d8
5
5
  SHA512:
6
- metadata.gz: 2477d8d7645bd64f0eacc1c674feefd64cee4f42df82b822733f4746a0ae7e79454d1b48a8875e50e17cac7414b5b8aafa54385f2862caa4d1c2ebd45f501f5b
7
- data.tar.gz: fcf2d0f9a7c6200fb7f3a65c7105faff009065e5d37733eb15ec2e20e33615db9ccde3445aabc2ed48c43e6151cca85532b337cfea97f755e90c015dfed31e9c
6
+ metadata.gz: 91126434e2749312639c995f30b21c18f4f4c61ca186fce546df9603fd04c126970903b46d27c16c23dbece402edc0b3a853fa59e332b11e2cf5db83c0effe49
7
+ data.tar.gz: 29d014f303f6b3347431352f3772fa2d26040f293cd8dbfa707984723e8adecc1dc9b24261d199d698cb25bb33638e93a832162530e487c59253417314b88d16
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.4)
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.4"
5
5
  end
@@ -36,4 +36,5 @@ module ApiSixClient
36
36
 
37
37
  class AuthInt < BaseV2Int; end
38
38
  class UasInt < BaseV2Int; end
39
+ class NtfInt < BaseV2Int; end
39
40
  end
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.4
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-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday