api_six_client 1.2.4 → 1.2.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/api_six_client/base.rb +20 -5
- data/lib/api_six_client/base_int.rb +3 -4
- data/lib/api_six_client/base_v2.rb +3 -4
- data/lib/api_six_client/base_v2_int.rb +12 -0
- data/lib/api_six_client/config.rb +1 -0
- data/lib/api_six_client/version.rb +1 -1
- data/lib/api_six_client.rb +16 -7
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21a2f166a3c9d795f709a20cee3a3abc731c79f98059f7c4e64781119aa5c073
|
4
|
+
data.tar.gz: db264a9c736d4eb52cdcdad4d0db9e225c0cbac9dbe204ce565856d46d90e982
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc5da9873c531487096614b72649450bad42468c3dc14ce92742e2e32d905364f31981561da3e116017c1180e5bb3a5aa1b120a88803650710cab591e6edb18d
|
7
|
+
data.tar.gz: 13f16ac218af4b9fbc61934d25295e4a6ba5120515521524d2f09338a23e6aa25b6907845c019420d59ec0cc6c45c4e7d27d0b3edbc522f9c92d78ac50d47cae
|
data/Gemfile.lock
CHANGED
data/lib/api_six_client/base.rb
CHANGED
@@ -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
|
12
|
-
@auth_token = auth_token
|
10
|
+
def initialize(endpoint: nil, auth_token: nil, debug_mode: false, dm: false)
|
11
|
+
@endpoint = endpoint
|
12
|
+
@auth_token = auth_token
|
13
|
+
@debug_mode = debug_mode || dm
|
13
14
|
|
14
|
-
|
15
|
-
|
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
|
43
|
+
@auth_token ||= ApiSixClient.config.auth_token
|
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
|
-
|
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
|
-
|
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
|
data/lib/api_six_client.rb
CHANGED
@@ -5,6 +5,7 @@ require 'api_six_client/config'
|
|
5
5
|
require 'api_six_client/base'
|
6
6
|
require 'api_six_client/base_v2'
|
7
7
|
require 'api_six_client/base_int'
|
8
|
+
require 'api_six_client/base_v2_int'
|
8
9
|
require 'api_six_client/errors'
|
9
10
|
|
10
11
|
module ApiSixClient
|
@@ -18,17 +19,25 @@ module ApiSixClient
|
|
18
19
|
|
19
20
|
class Brg < Base; end
|
20
21
|
class Gbk < Base; end
|
21
|
-
class Kms < Base; end
|
22
|
-
class Lyr < Base; end
|
23
22
|
class Mat < Base; end
|
24
23
|
class Val < Base; end
|
25
24
|
class Prj < Base; end
|
26
|
-
class
|
25
|
+
class Fin < Base; end
|
27
26
|
class Olc < Base; end
|
28
|
-
class Eno < Base; end
|
29
|
-
class Uas < Base; end
|
30
27
|
|
31
|
-
class
|
28
|
+
class Kms < BaseV2; end
|
29
|
+
class Lyr < BaseV2; end
|
30
|
+
class Eno < BaseV2; end
|
31
|
+
class Uas < BaseV2; end
|
32
|
+
|
32
33
|
class OlcInt < BaseInt; end
|
33
|
-
class
|
34
|
+
class BrgInt < BaseInt; end
|
35
|
+
class PrjInt < BaseInt; end
|
36
|
+
|
37
|
+
class AuthInt < BaseV2Int; end
|
38
|
+
class UasInt < BaseV2Int; end
|
39
|
+
class NtfInt < BaseV2Int; end
|
40
|
+
class MatInt < BaseV2Int; end
|
34
41
|
end
|
42
|
+
|
43
|
+
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.2.
|
4
|
+
version: 1.2.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-
|
11
|
+
date: 2023-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -44,6 +44,7 @@ files:
|
|
44
44
|
- lib/api_six_client/base.rb
|
45
45
|
- lib/api_six_client/base_int.rb
|
46
46
|
- lib/api_six_client/base_v2.rb
|
47
|
+
- lib/api_six_client/base_v2_int.rb
|
47
48
|
- lib/api_six_client/config.rb
|
48
49
|
- lib/api_six_client/errors.rb
|
49
50
|
- lib/api_six_client/version.rb
|