api_six_client 1.2.4 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- 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 +18 -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: 8135285e1f85df14ece68c7c636693b2f3ace1f23ec9dd5522633c36f22b1da1
|
4
|
+
data.tar.gz: 0a32d02140cce9c38301e2a6ac7bcda854968a426040187d2e1ba222b0762961
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ec31cba0fdaa8e4a4c7b5388a41a5f3294927456bc607ae167c7987d9567256817f0c8a294a7d593aa16cc7b2dbfdf3ff24dbee435bf0f1df028c7cf54a04ae
|
7
|
+
data.tar.gz: 7f0cb7ea861acb6bd497eda2b9e05bf784cf294b3a7ce1d501d1f7fa18b194a41d0e4303664315b5709632f1017c0e9e41b9b5b8c3db0eb62e8967ca13713808
|
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,27 @@ 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
|
41
|
+
class FinnInt < BaseV2Int; end
|
42
|
+
class LyrInt < BaseV2Int; end
|
34
43
|
end
|
44
|
+
|
45
|
+
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.6
|
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-24 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
|