ibm_watson 0.12.0 → 0.13.0

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: 0bd35c50ae41bcbfd37e8979725fa1c735802adaa9547a85f317bd8b06facfbb
4
- data.tar.gz: 99f6e5162166498402863f91e4aa657df34dbced4b6ac785b55fcb1a7a61998a
3
+ metadata.gz: 623224b14628779778a2d80370cf17dbee44d4f3e4f12cab7909c82dcfc8dd8b
4
+ data.tar.gz: f89601ca292a7aae3fb3c48e5f59fec837b300a4864857f557a3afd91f135449
5
5
  SHA512:
6
- metadata.gz: d43788276fa776b4ef6921243f02512d5a42ed82cf9925dab9ae5bae6941491aa27f2e15eddd531101d891dd74cd511a296383663b4f6aaab3dd6cf4bf19eaca
7
- data.tar.gz: e5f3692a356b306135b394e61f614041cadfe42a81cfabd4aaf4ffc89e9940b9fa0658e4b22c46843300fbf5498dbeaf22d0ce6064a3236f6c40e316c15e76d6
6
+ metadata.gz: 3e8d81a854c8ce99917f249bbadbee4edf69be9d90b2ebedfd8961ce4c8b0fa47bb89a628838fcfab6f33084c370dfec822a5d66b480ef3efda69fff86bae8eb
7
+ data.tar.gz: b4ff019bd8edf3ebdd7b959d975cb9ca147cd79b5b692c6fa806a075fde33e8704f35112320a0554599bde98707a6aba36a7520b2b9a855ddd1e125c189bae2f
@@ -22,6 +22,7 @@ require "concurrent"
22
22
  require "erb"
23
23
  require "json"
24
24
  require_relative "./detailed_response"
25
+ require_relative "./common.rb"
25
26
 
26
27
  require_relative "./watson_service"
27
28
 
@@ -117,7 +118,7 @@ module IBMWatson
117
118
 
118
119
  headers = {
119
120
  }
120
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=message"
121
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "message")
121
122
 
122
123
  params = {
123
124
  "version" => @version,
@@ -167,7 +168,7 @@ module IBMWatson
167
168
  def list_workspaces(page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
168
169
  headers = {
169
170
  }
170
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=list_workspaces"
171
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_workspaces")
171
172
 
172
173
  params = {
173
174
  "version" => @version,
@@ -216,7 +217,7 @@ module IBMWatson
216
217
  def create_workspace(name: nil, description: nil, language: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, metadata: nil, learning_opt_out: nil, system_settings: nil)
217
218
  headers = {
218
219
  }
219
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=create_workspace"
220
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_workspace")
220
221
 
221
222
  params = {
222
223
  "version" => @version
@@ -271,7 +272,7 @@ module IBMWatson
271
272
 
272
273
  headers = {
273
274
  }
274
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=get_workspace"
275
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_workspace")
275
276
 
276
277
  params = {
277
278
  "version" => @version,
@@ -330,7 +331,7 @@ module IBMWatson
330
331
 
331
332
  headers = {
332
333
  }
333
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=update_workspace"
334
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_workspace")
334
335
 
335
336
  params = {
336
337
  "version" => @version,
@@ -377,7 +378,7 @@ module IBMWatson
377
378
 
378
379
  headers = {
379
380
  }
380
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=delete_workspace"
381
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_workspace")
381
382
 
382
383
  params = {
383
384
  "version" => @version
@@ -423,7 +424,7 @@ module IBMWatson
423
424
 
424
425
  headers = {
425
426
  }
426
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=list_intents"
427
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_intents")
427
428
 
428
429
  params = {
429
430
  "version" => @version,
@@ -471,7 +472,7 @@ module IBMWatson
471
472
 
472
473
  headers = {
473
474
  }
474
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=create_intent"
475
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_intent")
475
476
 
476
477
  params = {
477
478
  "version" => @version
@@ -519,7 +520,7 @@ module IBMWatson
519
520
 
520
521
  headers = {
521
522
  }
522
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=get_intent"
523
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_intent")
523
524
 
524
525
  params = {
525
526
  "version" => @version,
@@ -564,7 +565,7 @@ module IBMWatson
564
565
 
565
566
  headers = {
566
567
  }
567
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=update_intent"
568
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_intent")
568
569
 
569
570
  params = {
570
571
  "version" => @version
@@ -606,7 +607,7 @@ module IBMWatson
606
607
 
607
608
  headers = {
608
609
  }
609
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=delete_intent"
610
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_intent")
610
611
 
611
612
  params = {
612
613
  "version" => @version
@@ -652,7 +653,7 @@ module IBMWatson
652
653
 
653
654
  headers = {
654
655
  }
655
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=list_examples"
656
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_examples")
656
657
 
657
658
  params = {
658
659
  "version" => @version,
@@ -700,7 +701,7 @@ module IBMWatson
700
701
 
701
702
  headers = {
702
703
  }
703
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=create_example"
704
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_example")
704
705
 
705
706
  params = {
706
707
  "version" => @version
@@ -746,7 +747,7 @@ module IBMWatson
746
747
 
747
748
  headers = {
748
749
  }
749
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=get_example"
750
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_example")
750
751
 
751
752
  params = {
752
753
  "version" => @version,
@@ -791,7 +792,7 @@ module IBMWatson
791
792
 
792
793
  headers = {
793
794
  }
794
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=update_example"
795
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_example")
795
796
 
796
797
  params = {
797
798
  "version" => @version
@@ -835,7 +836,7 @@ module IBMWatson
835
836
 
836
837
  headers = {
837
838
  }
838
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=delete_example"
839
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_example")
839
840
 
840
841
  params = {
841
842
  "version" => @version
@@ -878,7 +879,7 @@ module IBMWatson
878
879
 
879
880
  headers = {
880
881
  }
881
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=list_counterexamples"
882
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_counterexamples")
882
883
 
883
884
  params = {
884
885
  "version" => @version,
@@ -923,7 +924,7 @@ module IBMWatson
923
924
 
924
925
  headers = {
925
926
  }
926
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=create_counterexample"
927
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_counterexample")
927
928
 
928
929
  params = {
929
930
  "version" => @version
@@ -966,7 +967,7 @@ module IBMWatson
966
967
 
967
968
  headers = {
968
969
  }
969
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=get_counterexample"
970
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_counterexample")
970
971
 
971
972
  params = {
972
973
  "version" => @version,
@@ -1004,7 +1005,7 @@ module IBMWatson
1004
1005
 
1005
1006
  headers = {
1006
1007
  }
1007
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=update_counterexample"
1008
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_counterexample")
1008
1009
 
1009
1010
  params = {
1010
1011
  "version" => @version
@@ -1045,7 +1046,7 @@ module IBMWatson
1045
1046
 
1046
1047
  headers = {
1047
1048
  }
1048
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=delete_counterexample"
1049
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_counterexample")
1049
1050
 
1050
1051
  params = {
1051
1052
  "version" => @version
@@ -1091,7 +1092,7 @@ module IBMWatson
1091
1092
 
1092
1093
  headers = {
1093
1094
  }
1094
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=list_entities"
1095
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_entities")
1095
1096
 
1096
1097
  params = {
1097
1098
  "version" => @version,
@@ -1143,7 +1144,7 @@ module IBMWatson
1143
1144
 
1144
1145
  headers = {
1145
1146
  }
1146
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=create_entity"
1147
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_entity")
1147
1148
 
1148
1149
  params = {
1149
1150
  "version" => @version
@@ -1193,7 +1194,7 @@ module IBMWatson
1193
1194
 
1194
1195
  headers = {
1195
1196
  }
1196
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=get_entity"
1197
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_entity")
1197
1198
 
1198
1199
  params = {
1199
1200
  "version" => @version,
@@ -1240,7 +1241,7 @@ module IBMWatson
1240
1241
 
1241
1242
  headers = {
1242
1243
  }
1243
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=update_entity"
1244
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_entity")
1244
1245
 
1245
1246
  params = {
1246
1247
  "version" => @version
@@ -1284,7 +1285,7 @@ module IBMWatson
1284
1285
 
1285
1286
  headers = {
1286
1287
  }
1287
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=delete_entity"
1288
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_entity")
1288
1289
 
1289
1290
  params = {
1290
1291
  "version" => @version
@@ -1328,7 +1329,7 @@ module IBMWatson
1328
1329
 
1329
1330
  headers = {
1330
1331
  }
1331
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=list_mentions"
1332
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_mentions")
1332
1333
 
1333
1334
  params = {
1334
1335
  "version" => @version,
@@ -1378,7 +1379,7 @@ module IBMWatson
1378
1379
 
1379
1380
  headers = {
1380
1381
  }
1381
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=list_values"
1382
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_values")
1382
1383
 
1383
1384
  params = {
1384
1385
  "version" => @version,
@@ -1439,7 +1440,7 @@ module IBMWatson
1439
1440
 
1440
1441
  headers = {
1441
1442
  }
1442
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=create_value"
1443
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_value")
1443
1444
 
1444
1445
  params = {
1445
1446
  "version" => @version
@@ -1491,7 +1492,7 @@ module IBMWatson
1491
1492
 
1492
1493
  headers = {
1493
1494
  }
1494
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=get_value"
1495
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_value")
1495
1496
 
1496
1497
  params = {
1497
1498
  "version" => @version,
@@ -1550,7 +1551,7 @@ module IBMWatson
1550
1551
 
1551
1552
  headers = {
1552
1553
  }
1553
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=update_value"
1554
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_value")
1554
1555
 
1555
1556
  params = {
1556
1557
  "version" => @version
@@ -1597,7 +1598,7 @@ module IBMWatson
1597
1598
 
1598
1599
  headers = {
1599
1600
  }
1600
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=delete_value"
1601
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_value")
1601
1602
 
1602
1603
  params = {
1603
1604
  "version" => @version
@@ -1645,7 +1646,7 @@ module IBMWatson
1645
1646
 
1646
1647
  headers = {
1647
1648
  }
1648
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=list_synonyms"
1649
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_synonyms")
1649
1650
 
1650
1651
  params = {
1651
1652
  "version" => @version,
@@ -1694,7 +1695,7 @@ module IBMWatson
1694
1695
 
1695
1696
  headers = {
1696
1697
  }
1697
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=create_synonym"
1698
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_synonym")
1698
1699
 
1699
1700
  params = {
1700
1701
  "version" => @version
@@ -1742,7 +1743,7 @@ module IBMWatson
1742
1743
 
1743
1744
  headers = {
1744
1745
  }
1745
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=get_synonym"
1746
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_synonym")
1746
1747
 
1747
1748
  params = {
1748
1749
  "version" => @version,
@@ -1788,7 +1789,7 @@ module IBMWatson
1788
1789
 
1789
1790
  headers = {
1790
1791
  }
1791
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=update_synonym"
1792
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_synonym")
1792
1793
 
1793
1794
  params = {
1794
1795
  "version" => @version
@@ -1834,7 +1835,7 @@ module IBMWatson
1834
1835
 
1835
1836
  headers = {
1836
1837
  }
1837
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=delete_synonym"
1838
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_synonym")
1838
1839
 
1839
1840
  params = {
1840
1841
  "version" => @version
@@ -1876,7 +1877,7 @@ module IBMWatson
1876
1877
 
1877
1878
  headers = {
1878
1879
  }
1879
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=list_dialog_nodes"
1880
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_dialog_nodes")
1880
1881
 
1881
1882
  params = {
1882
1883
  "version" => @version,
@@ -1946,7 +1947,7 @@ module IBMWatson
1946
1947
 
1947
1948
  headers = {
1948
1949
  }
1949
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=create_dialog_node"
1950
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_dialog_node")
1950
1951
 
1951
1952
  params = {
1952
1953
  "version" => @version
@@ -2005,7 +2006,7 @@ module IBMWatson
2005
2006
 
2006
2007
  headers = {
2007
2008
  }
2008
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=get_dialog_node"
2009
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_dialog_node")
2009
2010
 
2010
2011
  params = {
2011
2012
  "version" => @version,
@@ -2072,7 +2073,7 @@ module IBMWatson
2072
2073
 
2073
2074
  headers = {
2074
2075
  }
2075
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=update_dialog_node"
2076
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_dialog_node")
2076
2077
 
2077
2078
  params = {
2078
2079
  "version" => @version
@@ -2129,7 +2130,7 @@ module IBMWatson
2129
2130
 
2130
2131
  headers = {
2131
2132
  }
2132
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=delete_dialog_node"
2133
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_dialog_node")
2133
2134
 
2134
2135
  params = {
2135
2136
  "version" => @version
@@ -2172,7 +2173,7 @@ module IBMWatson
2172
2173
 
2173
2174
  headers = {
2174
2175
  }
2175
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=list_logs"
2176
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_logs")
2176
2177
 
2177
2178
  params = {
2178
2179
  "version" => @version,
@@ -2217,7 +2218,7 @@ module IBMWatson
2217
2218
 
2218
2219
  headers = {
2219
2220
  }
2220
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=list_all_logs"
2221
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_all_logs")
2221
2222
 
2222
2223
  params = {
2223
2224
  "version" => @version,
@@ -2259,7 +2260,7 @@ module IBMWatson
2259
2260
 
2260
2261
  headers = {
2261
2262
  }
2262
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V1;operation_id=delete_user_data"
2263
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_user_data")
2263
2264
 
2264
2265
  params = {
2265
2266
  "version" => @version,
@@ -22,6 +22,7 @@ require "concurrent"
22
22
  require "erb"
23
23
  require "json"
24
24
  require_relative "./detailed_response"
25
+ require_relative "./common.rb"
25
26
 
26
27
  require_relative "./watson_service"
27
28
 
@@ -106,7 +107,7 @@ module IBMWatson
106
107
 
107
108
  headers = {
108
109
  }
109
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V2;operation_id=create_session"
110
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V2", operation_id: "create_session")
110
111
 
111
112
  params = {
112
113
  "version" => @version
@@ -143,7 +144,7 @@ module IBMWatson
143
144
 
144
145
  headers = {
145
146
  }
146
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V2;operation_id=delete_session"
147
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V2", operation_id: "delete_session")
147
148
 
148
149
  params = {
149
150
  "version" => @version
@@ -187,7 +188,7 @@ module IBMWatson
187
188
 
188
189
  headers = {
189
190
  }
190
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=conversation;service_version=V2;operation_id=message"
191
+ headers = Common.new.get_default_headers(headers: headers, service_name: "conversation", service_version: "V2", operation_id: "message")
191
192
 
192
193
  params = {
193
194
  "version" => @version
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module IBMWatson
4
+ # SDK Common class
5
+ class Common
6
+ def initialize(*); end
7
+
8
+ def get_default_headers(headers: {}, service_name: nil, service_version: nil, operation_id: nil)
9
+ user_agent_string = "watson-apis-ruby-sdk-" + IBMWatson::VERSION + " #{RbConfig::CONFIG["host"]}"
10
+ user_agent_string += " #{RbConfig::CONFIG["RUBY_BASE_NAME"]}-#{RbConfig::CONFIG["RUBY_PROGRAM_VERSION"]}"
11
+
12
+ headers["User-Agent"] = user_agent_string
13
+ return headers if service_name.nil? || service_version.nil? || operation_id.nil?
14
+
15
+ headers["X-IBMCloud-SDK-Analytics"] = "service_name=#{service_name};service_version=#{service_version};operation_id=#{operation_id}"
16
+ headers
17
+ end
18
+ end
19
+ end
@@ -21,6 +21,7 @@ require "concurrent"
21
21
  require "erb"
22
22
  require "json"
23
23
  require_relative "./detailed_response"
24
+ require_relative "./common.rb"
24
25
 
25
26
  require_relative "./watson_service"
26
27
 
@@ -93,7 +94,7 @@ module IBMWatson
93
94
 
94
95
  headers = {
95
96
  }
96
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=compare-comply;service_version=V1;operation_id=convert_to_html"
97
+ headers = Common.new.get_default_headers(headers: headers, service_name: "compare-comply", service_version: "V1", operation_id: "convert_to_html")
97
98
 
98
99
  params = {
99
100
  "version" => @version,
@@ -141,7 +142,7 @@ module IBMWatson
141
142
 
142
143
  headers = {
143
144
  }
144
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=compare-comply;service_version=V1;operation_id=classify_elements"
145
+ headers = Common.new.get_default_headers(headers: headers, service_name: "compare-comply", service_version: "V1", operation_id: "classify_elements")
145
146
 
146
147
  params = {
147
148
  "version" => @version,
@@ -189,7 +190,7 @@ module IBMWatson
189
190
 
190
191
  headers = {
191
192
  }
192
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=compare-comply;service_version=V1;operation_id=extract_tables"
193
+ headers = Common.new.get_default_headers(headers: headers, service_name: "compare-comply", service_version: "V1", operation_id: "extract_tables")
193
194
 
194
195
  params = {
195
196
  "version" => @version,
@@ -244,7 +245,7 @@ module IBMWatson
244
245
 
245
246
  headers = {
246
247
  }
247
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=compare-comply;service_version=V1;operation_id=compare_documents"
248
+ headers = Common.new.get_default_headers(headers: headers, service_name: "compare-comply", service_version: "V1", operation_id: "compare_documents")
248
249
 
249
250
  params = {
250
251
  "version" => @version,
@@ -300,7 +301,7 @@ module IBMWatson
300
301
 
301
302
  headers = {
302
303
  }
303
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=compare-comply;service_version=V1;operation_id=add_feedback"
304
+ headers = Common.new.get_default_headers(headers: headers, service_name: "compare-comply", service_version: "V1", operation_id: "add_feedback")
304
305
 
305
306
  params = {
306
307
  "version" => @version
@@ -373,7 +374,7 @@ module IBMWatson
373
374
  def list_feedback(feedback_type: nil, before: nil, after: nil, document_title: nil, model_id: nil, model_version: nil, category_removed: nil, category_added: nil, category_not_changed: nil, type_removed: nil, type_added: nil, type_not_changed: nil, page_limit: nil, cursor: nil, sort: nil, include_total: nil)
374
375
  headers = {
375
376
  }
376
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=compare-comply;service_version=V1;operation_id=list_feedback"
377
+ headers = Common.new.get_default_headers(headers: headers, service_name: "compare-comply", service_version: "V1", operation_id: "list_feedback")
377
378
 
378
379
  params = {
379
380
  "version" => @version,
@@ -421,7 +422,7 @@ module IBMWatson
421
422
 
422
423
  headers = {
423
424
  }
424
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=compare-comply;service_version=V1;operation_id=get_feedback"
425
+ headers = Common.new.get_default_headers(headers: headers, service_name: "compare-comply", service_version: "V1", operation_id: "get_feedback")
425
426
 
426
427
  params = {
427
428
  "version" => @version,
@@ -454,7 +455,7 @@ module IBMWatson
454
455
 
455
456
  headers = {
456
457
  }
457
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=compare-comply;service_version=V1;operation_id=delete_feedback"
458
+ headers = Common.new.get_default_headers(headers: headers, service_name: "compare-comply", service_version: "V1", operation_id: "delete_feedback")
458
459
 
459
460
  params = {
460
461
  "version" => @version,
@@ -524,7 +525,7 @@ module IBMWatson
524
525
 
525
526
  headers = {
526
527
  }
527
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=compare-comply;service_version=V1;operation_id=create_batch"
528
+ headers = Common.new.get_default_headers(headers: headers, service_name: "compare-comply", service_version: "V1", operation_id: "create_batch")
528
529
 
529
530
  params = {
530
531
  "version" => @version,
@@ -575,7 +576,7 @@ module IBMWatson
575
576
  def list_batches
576
577
  headers = {
577
578
  }
578
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=compare-comply;service_version=V1;operation_id=list_batches"
579
+ headers = Common.new.get_default_headers(headers: headers, service_name: "compare-comply", service_version: "V1", operation_id: "list_batches")
579
580
 
580
581
  params = {
581
582
  "version" => @version
@@ -604,7 +605,7 @@ module IBMWatson
604
605
 
605
606
  headers = {
606
607
  }
607
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=compare-comply;service_version=V1;operation_id=get_batch"
608
+ headers = Common.new.get_default_headers(headers: headers, service_name: "compare-comply", service_version: "V1", operation_id: "get_batch")
608
609
 
609
610
  params = {
610
611
  "version" => @version
@@ -641,7 +642,7 @@ module IBMWatson
641
642
 
642
643
  headers = {
643
644
  }
644
- headers["X-IBMCloud-SDK-Analytics"] = "service_name=compare-comply;service_version=V1;operation_id=update_batch"
645
+ headers = Common.new.get_default_headers(headers: headers, service_name: "compare-comply", service_version: "V1", operation_id: "update_batch")
645
646
 
646
647
  params = {
647
648
  "version" => @version,