wolf_core 0.1.34 → 0.1.36
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05fe2d492ce2f8260270eee75659448aad2bb510b6a4099b2067fa346e3f3e61
|
4
|
+
data.tar.gz: f233b5c12098def0614fee840da78b64cd6cf271460a46b2a8ba1973ef0c16db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6662eff1ac373047c599f190888d65bfb42baa726d540ac59890b8f4eaadbfdaee184e3b7bfff35715c54f3ee6e180e26abc4e5e558f67264f3dc68320615cb8
|
7
|
+
data.tar.gz: '0918137298ac2c0cdaf98e4f5ccee3ae443006413e26a88f94e0021852fdb1a5dad5c6267c70b3cafb34e06942873a49ac28dabc336a382379f5c3e90f63dfb4'
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module WolfCore
|
2
2
|
module FkmOperations
|
3
3
|
include WolfCore::HttpOperations
|
4
|
+
include WolfCore::LoggingUtils
|
4
5
|
|
5
6
|
def get_foreign_key_destination_id(tenant:, source:, source_id:, destination:)
|
6
7
|
foreign_keys = get_foreign_keys(tenant: tenant, source: source, source_id: source_id)
|
@@ -12,10 +13,22 @@ module WolfCore
|
|
12
13
|
response = http_get(
|
13
14
|
url: "#{ENV['FKM_URL']}/Prod/lookup?tenant=#{tenant}&source=#{source}&source_id=#{source_id}"
|
14
15
|
)
|
15
|
-
|
16
|
-
|
16
|
+
response = parse_http_response(response)
|
17
|
+
log_object 'get_foreign_keys response is'
|
18
|
+
log_object response
|
17
19
|
validate_http_response(response: response, message: 'Error getting foreign keys')
|
18
|
-
|
20
|
+
response.body
|
21
|
+
end
|
22
|
+
|
23
|
+
def get_foreign_keys_by_destination(tenant:, destination:, destination_id:)
|
24
|
+
response = http_get(
|
25
|
+
url: "#{ENV['FKM_URL']}/Prod/lookup?tenant=#{tenant}&destination=#{destination}&destination_id=#{destination_id}"
|
26
|
+
)
|
27
|
+
response = parse_http_response(response)
|
28
|
+
log_object 'get_foreign_keys_by_destination response is'
|
29
|
+
log_object response
|
30
|
+
validate_http_response(response: response, message: 'Error getting foreign keys by destination id')
|
31
|
+
response.body
|
19
32
|
end
|
20
33
|
|
21
34
|
def create_foreign_key(tenant:, source:, source_id:, destination:, destination_id:)
|
@@ -29,8 +42,9 @@ module WolfCore
|
|
29
42
|
destination_id: destination_id
|
30
43
|
}
|
31
44
|
)
|
32
|
-
|
33
|
-
|
45
|
+
response = parse_http_response(response)
|
46
|
+
log_object 'create_foreign_key response is'
|
47
|
+
log_object response
|
34
48
|
validate_http_response(response: response, message: 'Error creating foreign key')
|
35
49
|
parse_http_response(response).body
|
36
50
|
end
|
@@ -2,10 +2,10 @@ module WolfCore
|
|
2
2
|
module LoggingUtils
|
3
3
|
def log_object(object)
|
4
4
|
case object
|
5
|
-
when Hash, OpenStruct
|
5
|
+
when Hash, Array, OpenStruct
|
6
6
|
object = object.to_h if object.instance_of?(OpenStruct)
|
7
7
|
puts object.to_json
|
8
|
-
when
|
8
|
+
when Object
|
9
9
|
pp object
|
10
10
|
else
|
11
11
|
puts object
|
data/lib/wolf_core/version.rb
CHANGED