@stigg/typescript-mcp 0.1.0-beta.34 → 0.1.0-beta.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.
- package/code-tool-worker.d.mts.map +1 -1
- package/code-tool-worker.d.ts.map +1 -1
- package/code-tool-worker.js +2 -0
- package/code-tool-worker.js.map +1 -1
- package/code-tool-worker.mjs +2 -0
- package/code-tool-worker.mjs.map +1 -1
- package/local-docs-search.d.mts.map +1 -1
- package/local-docs-search.d.ts.map +1 -1
- package/local-docs-search.js +216 -112
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +216 -112
- package/local-docs-search.mjs.map +1 -1
- package/methods.d.mts.map +1 -1
- package/methods.d.ts.map +1 -1
- package/methods.js +12 -0
- package/methods.js.map +1 -1
- package/methods.mjs +12 -0
- package/methods.mjs.map +1 -1
- package/package.json +2 -2
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/code-tool-worker.ts +2 -0
- package/src/local-docs-search.ts +237 -119
- package/src/methods.ts +12 -0
- package/src/server.ts +1 -1
package/src/local-docs-search.ts
CHANGED
|
@@ -100,7 +100,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
100
100
|
'CustomerRetrieveParams parameters = new() { ID = "x" };\n\nvar customerResponse = await client.V1.Customers.Retrieve(parameters);\n\nConsole.WriteLine(customerResponse);',
|
|
101
101
|
},
|
|
102
102
|
http: {
|
|
103
|
-
example: 'curl https://
|
|
103
|
+
example: 'curl https://api.stigg.io/api/v1/customers/$ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
104
104
|
},
|
|
105
105
|
},
|
|
106
106
|
},
|
|
@@ -168,7 +168,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
168
168
|
},
|
|
169
169
|
http: {
|
|
170
170
|
example:
|
|
171
|
-
"curl https://
|
|
171
|
+
"curl https://api.stigg.io/api/v1/customers/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"X-API-KEY: $STIGG_API_KEY\" \\\n -d '{}'",
|
|
172
172
|
},
|
|
173
173
|
},
|
|
174
174
|
},
|
|
@@ -230,7 +230,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
230
230
|
'CustomerListParams parameters = new();\n\nvar page = await client.V1.Customers.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
231
231
|
},
|
|
232
232
|
http: {
|
|
233
|
-
example: 'curl https://
|
|
233
|
+
example: 'curl https://api.stigg.io/api/v1/customers \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
234
234
|
},
|
|
235
235
|
},
|
|
236
236
|
},
|
|
@@ -300,7 +300,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
300
300
|
},
|
|
301
301
|
http: {
|
|
302
302
|
example:
|
|
303
|
-
'curl https://
|
|
303
|
+
'curl https://api.stigg.io/api/v1/customers \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "id": "id"\n }\'',
|
|
304
304
|
},
|
|
305
305
|
},
|
|
306
306
|
},
|
|
@@ -355,7 +355,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
355
355
|
},
|
|
356
356
|
http: {
|
|
357
357
|
example:
|
|
358
|
-
'curl https://
|
|
358
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
359
359
|
},
|
|
360
360
|
},
|
|
361
361
|
},
|
|
@@ -409,7 +409,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
409
409
|
},
|
|
410
410
|
http: {
|
|
411
411
|
example:
|
|
412
|
-
'curl https://
|
|
412
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/unarchive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
413
413
|
},
|
|
414
414
|
},
|
|
415
415
|
},
|
|
@@ -469,7 +469,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
469
469
|
},
|
|
470
470
|
http: {
|
|
471
471
|
example:
|
|
472
|
-
'curl https://
|
|
472
|
+
'curl https://api.stigg.io/api/v1/customers/import \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "customers": [\n {\n "id": "id",\n "email": "dev@stainless.com",\n "name": "name"\n }\n ]\n }\'',
|
|
473
473
|
},
|
|
474
474
|
},
|
|
475
475
|
},
|
|
@@ -529,7 +529,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
529
529
|
},
|
|
530
530
|
http: {
|
|
531
531
|
example:
|
|
532
|
-
'curl https://
|
|
532
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/resources \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
533
533
|
},
|
|
534
534
|
},
|
|
535
535
|
},
|
|
@@ -584,7 +584,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
584
584
|
},
|
|
585
585
|
http: {
|
|
586
586
|
example:
|
|
587
|
-
'curl https://
|
|
587
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/entitlements \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
588
588
|
},
|
|
589
589
|
},
|
|
590
590
|
},
|
|
@@ -648,7 +648,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
648
648
|
},
|
|
649
649
|
http: {
|
|
650
650
|
example:
|
|
651
|
-
'curl https://
|
|
651
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/entitlements/check \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
652
652
|
},
|
|
653
653
|
},
|
|
654
654
|
},
|
|
@@ -712,7 +712,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
712
712
|
},
|
|
713
713
|
http: {
|
|
714
714
|
example:
|
|
715
|
-
'curl https://
|
|
715
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/payment-method \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "integrationId": "integrationId",\n "paymentMethodId": "paymentMethodId",\n "vendorIdentifier": "AUTH0"\n }\'',
|
|
716
716
|
},
|
|
717
717
|
},
|
|
718
718
|
},
|
|
@@ -767,7 +767,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
767
767
|
},
|
|
768
768
|
http: {
|
|
769
769
|
example:
|
|
770
|
-
'curl https://
|
|
770
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/payment-method \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
771
771
|
},
|
|
772
772
|
},
|
|
773
773
|
},
|
|
@@ -830,7 +830,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
830
830
|
},
|
|
831
831
|
http: {
|
|
832
832
|
example:
|
|
833
|
-
'curl https://
|
|
833
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/promotional-entitlements \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
834
834
|
},
|
|
835
835
|
},
|
|
836
836
|
},
|
|
@@ -891,7 +891,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
891
891
|
},
|
|
892
892
|
http: {
|
|
893
893
|
example:
|
|
894
|
-
'curl https://
|
|
894
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/promotional-entitlements \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "promotionalEntitlements": [\n {\n "customEndDate": "2019-12-27T18:11:19.117Z",\n "enumValues": [\n "string"\n ],\n "featureId": "featureId",\n "hasSoftLimit": true,\n "hasUnlimitedUsage": true,\n "isVisible": true,\n "monthlyResetPeriodConfiguration": {\n "accordingTo": "SubscriptionStart"\n },\n "period": "1 week",\n "resetPeriod": "YEAR",\n "usageLimit": -9007199254740991,\n "weeklyResetPeriodConfiguration": {\n "accordingTo": "SubscriptionStart"\n },\n "yearlyResetPeriodConfiguration": {\n "accordingTo": "SubscriptionStart"\n }\n }\n ]\n }\'',
|
|
895
895
|
},
|
|
896
896
|
},
|
|
897
897
|
},
|
|
@@ -947,7 +947,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
947
947
|
},
|
|
948
948
|
http: {
|
|
949
949
|
example:
|
|
950
|
-
'curl https://
|
|
950
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/promotional-entitlements/$FEATURE_ID \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
951
951
|
},
|
|
952
952
|
},
|
|
953
953
|
},
|
|
@@ -1009,7 +1009,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1009
1009
|
},
|
|
1010
1010
|
http: {
|
|
1011
1011
|
example:
|
|
1012
|
-
'curl https://
|
|
1012
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/integrations \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1013
1013
|
},
|
|
1014
1014
|
},
|
|
1015
1015
|
},
|
|
@@ -1072,7 +1072,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1072
1072
|
},
|
|
1073
1073
|
http: {
|
|
1074
1074
|
example:
|
|
1075
|
-
'curl https://
|
|
1075
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/integrations \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "id": "id",\n "syncedEntityId": "syncedEntityId",\n "vendorIdentifier": "AUTH0"\n }\'',
|
|
1076
1076
|
},
|
|
1077
1077
|
},
|
|
1078
1078
|
},
|
|
@@ -1127,7 +1127,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1127
1127
|
},
|
|
1128
1128
|
http: {
|
|
1129
1129
|
example:
|
|
1130
|
-
'curl https://
|
|
1130
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/integrations/$INTEGRATION_ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1131
1131
|
},
|
|
1132
1132
|
},
|
|
1133
1133
|
},
|
|
@@ -1188,7 +1188,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1188
1188
|
},
|
|
1189
1189
|
http: {
|
|
1190
1190
|
example:
|
|
1191
|
-
'curl https://
|
|
1191
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/integrations/$INTEGRATION_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "syncedEntityId": "syncedEntityId"\n }\'',
|
|
1192
1192
|
},
|
|
1193
1193
|
},
|
|
1194
1194
|
},
|
|
@@ -1243,7 +1243,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1243
1243
|
},
|
|
1244
1244
|
http: {
|
|
1245
1245
|
example:
|
|
1246
|
-
'curl https://
|
|
1246
|
+
'curl https://api.stigg.io/api/v1/customers/$ID/integrations/$INTEGRATION_ID \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1247
1247
|
},
|
|
1248
1248
|
},
|
|
1249
1249
|
},
|
|
@@ -1297,8 +1297,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1297
1297
|
'SubscriptionRetrieveParams parameters = new() { ID = "x" };\n\nvar subscription = await client.V1.Subscriptions.Retrieve(parameters);\n\nConsole.WriteLine(subscription);',
|
|
1298
1298
|
},
|
|
1299
1299
|
http: {
|
|
1300
|
-
example:
|
|
1301
|
-
'curl https://edge.api.stigg.io/api/v1/subscriptions/$ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1300
|
+
example: 'curl https://api.stigg.io/api/v1/subscriptions/$ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1302
1301
|
},
|
|
1303
1302
|
},
|
|
1304
1303
|
},
|
|
@@ -1364,7 +1363,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1364
1363
|
'SubscriptionListParams parameters = new();\n\nvar page = await client.V1.Subscriptions.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
1365
1364
|
},
|
|
1366
1365
|
http: {
|
|
1367
|
-
example: 'curl https://
|
|
1366
|
+
example: 'curl https://api.stigg.io/api/v1/subscriptions \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1368
1367
|
},
|
|
1369
1368
|
},
|
|
1370
1369
|
},
|
|
@@ -1450,7 +1449,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1450
1449
|
},
|
|
1451
1450
|
http: {
|
|
1452
1451
|
example:
|
|
1453
|
-
'curl https://
|
|
1452
|
+
'curl https://api.stigg.io/api/v1/subscriptions \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "customerId": "customerId",\n "planId": "planId"\n }\'',
|
|
1454
1453
|
},
|
|
1455
1454
|
},
|
|
1456
1455
|
},
|
|
@@ -1511,7 +1510,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1511
1510
|
},
|
|
1512
1511
|
http: {
|
|
1513
1512
|
example:
|
|
1514
|
-
'curl https://
|
|
1513
|
+
'curl https://api.stigg.io/api/v1/subscriptions/$ID/transfer \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "destinationResourceId": "destinationResourceId"\n }\'',
|
|
1515
1514
|
},
|
|
1516
1515
|
},
|
|
1517
1516
|
},
|
|
@@ -1571,7 +1570,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1571
1570
|
},
|
|
1572
1571
|
http: {
|
|
1573
1572
|
example:
|
|
1574
|
-
"curl https://
|
|
1573
|
+
"curl https://api.stigg.io/api/v1/subscriptions/$ID/migrate \\\n -H 'Content-Type: application/json' \\\n -H \"X-API-KEY: $STIGG_API_KEY\" \\\n -d '{}'",
|
|
1575
1574
|
},
|
|
1576
1575
|
},
|
|
1577
1576
|
},
|
|
@@ -1632,7 +1631,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1632
1631
|
},
|
|
1633
1632
|
http: {
|
|
1634
1633
|
example:
|
|
1635
|
-
'curl https://
|
|
1634
|
+
'curl https://api.stigg.io/api/v1/subscriptions/$ID/delegate \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "targetCustomerId": "targetCustomerId"\n }\'',
|
|
1636
1635
|
},
|
|
1637
1636
|
},
|
|
1638
1637
|
},
|
|
@@ -1707,7 +1706,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1707
1706
|
},
|
|
1708
1707
|
http: {
|
|
1709
1708
|
example:
|
|
1710
|
-
'curl https://
|
|
1709
|
+
'curl https://api.stigg.io/api/v1/subscriptions/preview \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "customerId": "customerId",\n "planId": "planId"\n }\'',
|
|
1711
1710
|
},
|
|
1712
1711
|
},
|
|
1713
1712
|
},
|
|
@@ -1783,7 +1782,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1783
1782
|
},
|
|
1784
1783
|
http: {
|
|
1785
1784
|
example:
|
|
1786
|
-
"curl https://
|
|
1785
|
+
"curl https://api.stigg.io/api/v1/subscriptions/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"X-API-KEY: $STIGG_API_KEY\" \\\n -d '{}'",
|
|
1787
1786
|
},
|
|
1788
1787
|
},
|
|
1789
1788
|
},
|
|
@@ -1843,7 +1842,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1843
1842
|
},
|
|
1844
1843
|
http: {
|
|
1845
1844
|
example:
|
|
1846
|
-
'curl https://
|
|
1845
|
+
'curl https://api.stigg.io/api/v1/subscriptions/import \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "subscriptions": [\n {\n "id": "id",\n "customerId": "customerId",\n "planId": "planId"\n }\n ]\n }\'',
|
|
1847
1846
|
},
|
|
1848
1847
|
},
|
|
1849
1848
|
},
|
|
@@ -1906,7 +1905,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1906
1905
|
},
|
|
1907
1906
|
http: {
|
|
1908
1907
|
example:
|
|
1909
|
-
"curl https://
|
|
1908
|
+
"curl https://api.stigg.io/api/v1/subscriptions/$ID/cancel \\\n -H 'Content-Type: application/json' \\\n -H \"X-API-KEY: $STIGG_API_KEY\" \\\n -d '{}'",
|
|
1910
1909
|
},
|
|
1911
1910
|
},
|
|
1912
1911
|
},
|
|
@@ -1960,7 +1959,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1960
1959
|
},
|
|
1961
1960
|
http: {
|
|
1962
1961
|
example:
|
|
1963
|
-
'curl https://
|
|
1962
|
+
'curl https://api.stigg.io/api/v1/subscriptions/$ID/future-update/pending-payment \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1964
1963
|
},
|
|
1965
1964
|
},
|
|
1966
1965
|
},
|
|
@@ -2014,7 +2013,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2014
2013
|
},
|
|
2015
2014
|
http: {
|
|
2016
2015
|
example:
|
|
2017
|
-
'curl https://
|
|
2016
|
+
'curl https://api.stigg.io/api/v1/subscriptions/$ID/future-update/schedule \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2018
2017
|
},
|
|
2019
2018
|
},
|
|
2020
2019
|
},
|
|
@@ -2069,7 +2068,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2069
2068
|
},
|
|
2070
2069
|
http: {
|
|
2071
2070
|
example:
|
|
2072
|
-
"curl https://
|
|
2071
|
+
"curl https://api.stigg.io/api/v1/subscriptions/$ID/usage/charge \\\n -H 'Content-Type: application/json' \\\n -H \"X-API-KEY: $STIGG_API_KEY\" \\\n -d '{}'",
|
|
2073
2072
|
},
|
|
2074
2073
|
},
|
|
2075
2074
|
},
|
|
@@ -2122,7 +2121,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2122
2121
|
},
|
|
2123
2122
|
http: {
|
|
2124
2123
|
example:
|
|
2125
|
-
'curl https://
|
|
2124
|
+
'curl https://api.stigg.io/api/v1/subscriptions/$ID/usage/sync \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2126
2125
|
},
|
|
2127
2126
|
},
|
|
2128
2127
|
},
|
|
@@ -2176,7 +2175,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2176
2175
|
},
|
|
2177
2176
|
http: {
|
|
2178
2177
|
example:
|
|
2179
|
-
'curl https://
|
|
2178
|
+
'curl https://api.stigg.io/api/v1/subscriptions/$ID/invoice/paid \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2180
2179
|
},
|
|
2181
2180
|
},
|
|
2182
2181
|
},
|
|
@@ -2242,7 +2241,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2242
2241
|
},
|
|
2243
2242
|
http: {
|
|
2244
2243
|
example:
|
|
2245
|
-
'curl https://
|
|
2244
|
+
'curl https://api.stigg.io/api/v1/coupons \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "id": "id",\n "amountsOff": [\n {\n "amount": 0,\n "currency": "usd"\n }\n ],\n "description": "description",\n "durationInMonths": 1,\n "metadata": {\n "foo": "string"\n },\n "name": "name",\n "percentOff": 1\n }\'',
|
|
2246
2245
|
},
|
|
2247
2246
|
},
|
|
2248
2247
|
},
|
|
@@ -2305,7 +2304,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2305
2304
|
'CouponListParams parameters = new();\n\nvar page = await client.V1.Coupons.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
2306
2305
|
},
|
|
2307
2306
|
http: {
|
|
2308
|
-
example: 'curl https://
|
|
2307
|
+
example: 'curl https://api.stigg.io/api/v1/coupons \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2309
2308
|
},
|
|
2310
2309
|
},
|
|
2311
2310
|
},
|
|
@@ -2358,7 +2357,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2358
2357
|
'CouponRetrieveParams parameters = new() { ID = "x" };\n\nvar coupon = await client.V1.Coupons.Retrieve(parameters);\n\nConsole.WriteLine(coupon);',
|
|
2359
2358
|
},
|
|
2360
2359
|
http: {
|
|
2361
|
-
example: 'curl https://
|
|
2360
|
+
example: 'curl https://api.stigg.io/api/v1/coupons/$ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2362
2361
|
},
|
|
2363
2362
|
},
|
|
2364
2363
|
},
|
|
@@ -2419,7 +2418,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2419
2418
|
},
|
|
2420
2419
|
http: {
|
|
2421
2420
|
example:
|
|
2422
|
-
"curl https://
|
|
2421
|
+
"curl https://api.stigg.io/api/v1/coupons/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"X-API-KEY: $STIGG_API_KEY\" \\\n -d '{}'",
|
|
2423
2422
|
},
|
|
2424
2423
|
},
|
|
2425
2424
|
},
|
|
@@ -2473,7 +2472,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2473
2472
|
},
|
|
2474
2473
|
http: {
|
|
2475
2474
|
example:
|
|
2476
|
-
'curl https://
|
|
2475
|
+
'curl https://api.stigg.io/api/v1/coupons/$ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2477
2476
|
},
|
|
2478
2477
|
},
|
|
2479
2478
|
},
|
|
@@ -2532,7 +2531,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2532
2531
|
},
|
|
2533
2532
|
http: {
|
|
2534
2533
|
example:
|
|
2535
|
-
'curl https://
|
|
2534
|
+
'curl https://api.stigg.io/api/v1/events \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "events": [\n {\n "customerId": "customerId",\n "eventName": "x",\n "idempotencyKey": "x"\n }\n ]\n }\'',
|
|
2536
2535
|
},
|
|
2537
2536
|
},
|
|
2538
2537
|
},
|
|
@@ -2586,7 +2585,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2586
2585
|
},
|
|
2587
2586
|
http: {
|
|
2588
2587
|
example:
|
|
2589
|
-
"curl https://
|
|
2588
|
+
"curl https://api.stigg.io/api/v1/data-export/sync \\\n -H 'Content-Type: application/json' \\\n -H \"X-API-KEY: $STIGG_API_KEY\" \\\n -d '{}'",
|
|
2590
2589
|
},
|
|
2591
2590
|
},
|
|
2592
2591
|
},
|
|
@@ -2647,7 +2646,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2647
2646
|
},
|
|
2648
2647
|
http: {
|
|
2649
2648
|
example:
|
|
2650
|
-
'curl https://
|
|
2649
|
+
'curl https://api.stigg.io/api/v1/data-export/scoped-token \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "applicationOrigin": "x"\n }\'',
|
|
2651
2650
|
},
|
|
2652
2651
|
},
|
|
2653
2652
|
},
|
|
@@ -2700,8 +2699,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2700
2699
|
'DataExportListModelsParams parameters = new();\n\nvar response = await client.V1.Events.DataExport.ListModels(parameters);\n\nConsole.WriteLine(response);',
|
|
2701
2700
|
},
|
|
2702
2701
|
http: {
|
|
2703
|
-
example:
|
|
2704
|
-
'curl https://edge.api.stigg.io/api/v1/data-export/models \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2702
|
+
example: 'curl https://api.stigg.io/api/v1/data-export/models \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2705
2703
|
},
|
|
2706
2704
|
},
|
|
2707
2705
|
},
|
|
@@ -2763,7 +2761,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2763
2761
|
},
|
|
2764
2762
|
http: {
|
|
2765
2763
|
example:
|
|
2766
|
-
'curl https://
|
|
2764
|
+
'curl https://api.stigg.io/api/v1/data-export/destinations \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "destinationId": "x",\n "destinationType": "x"\n }\'',
|
|
2767
2765
|
},
|
|
2768
2766
|
},
|
|
2769
2767
|
},
|
|
@@ -2818,7 +2816,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2818
2816
|
},
|
|
2819
2817
|
http: {
|
|
2820
2818
|
example:
|
|
2821
|
-
'curl https://
|
|
2819
|
+
'curl https://api.stigg.io/api/v1/data-export/destinations/$DESTINATION_ID \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2822
2820
|
},
|
|
2823
2821
|
},
|
|
2824
2822
|
},
|
|
@@ -2880,7 +2878,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2880
2878
|
},
|
|
2881
2879
|
http: {
|
|
2882
2880
|
example:
|
|
2883
|
-
'curl https://
|
|
2881
|
+
'curl https://api.stigg.io/api/v1/data-export/destinations/$DESTINATION_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "enabledModels": [\n "x"\n ],\n "integrationId": "x"\n }\'',
|
|
2884
2882
|
},
|
|
2885
2883
|
},
|
|
2886
2884
|
},
|
|
@@ -2950,7 +2948,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
2950
2948
|
},
|
|
2951
2949
|
http: {
|
|
2952
2950
|
example:
|
|
2953
|
-
'curl https://
|
|
2951
|
+
'curl https://api.stigg.io/api/v1-beta/customers/$ID/governance \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2954
2952
|
},
|
|
2955
2953
|
},
|
|
2956
2954
|
},
|
|
@@ -3017,7 +3015,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3017
3015
|
'CreditGetUsageParams parameters = new() { CustomerID = "customerId" };\n\nvar response = await client.V1.Credits.GetUsage(parameters);\n\nConsole.WriteLine(response);',
|
|
3018
3016
|
},
|
|
3019
3017
|
http: {
|
|
3020
|
-
example: 'curl https://
|
|
3018
|
+
example: 'curl https://api.stigg.io/api/v1/credits/usage \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3021
3019
|
},
|
|
3022
3020
|
},
|
|
3023
3021
|
},
|
|
@@ -3078,7 +3076,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3078
3076
|
},
|
|
3079
3077
|
http: {
|
|
3080
3078
|
example:
|
|
3081
|
-
'curl https://
|
|
3079
|
+
'curl https://api.stigg.io/api/v1/credits/auto-recharge \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3082
3080
|
},
|
|
3083
3081
|
},
|
|
3084
3082
|
},
|
|
@@ -3140,8 +3138,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3140
3138
|
'CreditListLedgerParams parameters = new() { CustomerID = "customerId" };\n\nvar page = await client.V1.Credits.ListLedger(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
3141
3139
|
},
|
|
3142
3140
|
http: {
|
|
3143
|
-
example:
|
|
3144
|
-
'curl https://edge.api.stigg.io/api/v1/credits/ledger \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3141
|
+
example: 'curl https://api.stigg.io/api/v1/credits/ledger \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3145
3142
|
},
|
|
3146
3143
|
},
|
|
3147
3144
|
},
|
|
@@ -3204,8 +3201,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3204
3201
|
'GrantListParams parameters = new() { CustomerID = "customerId" };\n\nvar page = await client.V1.Credits.Grants.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
3205
3202
|
},
|
|
3206
3203
|
http: {
|
|
3207
|
-
example:
|
|
3208
|
-
'curl https://edge.api.stigg.io/api/v1/credits/grants \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3204
|
+
example: 'curl https://api.stigg.io/api/v1/credits/grants \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3209
3205
|
},
|
|
3210
3206
|
},
|
|
3211
3207
|
},
|
|
@@ -3279,7 +3275,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3279
3275
|
},
|
|
3280
3276
|
http: {
|
|
3281
3277
|
example:
|
|
3282
|
-
'curl https://
|
|
3278
|
+
'curl https://api.stigg.io/api/v1/credits/grants \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "amount": 0,\n "currencyId": "currencyId",\n "customerId": "customerId",\n "displayName": "displayName",\n "grantType": "PAID"\n }\'',
|
|
3283
3279
|
},
|
|
3284
3280
|
},
|
|
3285
3281
|
},
|
|
@@ -3333,7 +3329,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3333
3329
|
},
|
|
3334
3330
|
http: {
|
|
3335
3331
|
example:
|
|
3336
|
-
'curl https://
|
|
3332
|
+
'curl https://api.stigg.io/api/v1/credits/grants/$ID/void \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3337
3333
|
},
|
|
3338
3334
|
},
|
|
3339
3335
|
},
|
|
@@ -3395,7 +3391,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3395
3391
|
},
|
|
3396
3392
|
http: {
|
|
3397
3393
|
example:
|
|
3398
|
-
'curl https://
|
|
3394
|
+
'curl https://api.stigg.io/api/v1/credits/custom-currencies \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3399
3395
|
},
|
|
3400
3396
|
},
|
|
3401
3397
|
},
|
|
@@ -3459,7 +3455,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3459
3455
|
},
|
|
3460
3456
|
http: {
|
|
3461
3457
|
example:
|
|
3462
|
-
'curl https://
|
|
3458
|
+
'curl https://api.stigg.io/api/v1/credits/custom-currencies \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "id": "id",\n "displayName": "displayName"\n }\'',
|
|
3463
3459
|
},
|
|
3464
3460
|
},
|
|
3465
3461
|
},
|
|
@@ -3523,7 +3519,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3523
3519
|
},
|
|
3524
3520
|
http: {
|
|
3525
3521
|
example:
|
|
3526
|
-
"curl https://
|
|
3522
|
+
"curl https://api.stigg.io/api/v1/credits/custom-currencies/$CURRENCY_ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"X-API-KEY: $STIGG_API_KEY\" \\\n -d '{}'",
|
|
3527
3523
|
},
|
|
3528
3524
|
},
|
|
3529
3525
|
},
|
|
@@ -3579,7 +3575,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3579
3575
|
},
|
|
3580
3576
|
http: {
|
|
3581
3577
|
example:
|
|
3582
|
-
'curl https://
|
|
3578
|
+
'curl https://api.stigg.io/api/v1/credits/custom-currencies/$CURRENCY_ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3583
3579
|
},
|
|
3584
3580
|
},
|
|
3585
3581
|
},
|
|
@@ -3635,7 +3631,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3635
3631
|
},
|
|
3636
3632
|
http: {
|
|
3637
3633
|
example:
|
|
3638
|
-
'curl https://
|
|
3634
|
+
'curl https://api.stigg.io/api/v1/credits/custom-currencies/$CURRENCY_ID/unarchive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3639
3635
|
},
|
|
3640
3636
|
},
|
|
3641
3637
|
},
|
|
@@ -3690,7 +3686,132 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3690
3686
|
},
|
|
3691
3687
|
http: {
|
|
3692
3688
|
example:
|
|
3693
|
-
'curl https://
|
|
3689
|
+
'curl https://api.stigg.io/api/v1/credits/custom-currencies/$CURRENCY_ID/associated-entities \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3690
|
+
},
|
|
3691
|
+
},
|
|
3692
|
+
},
|
|
3693
|
+
{
|
|
3694
|
+
name: 'consume',
|
|
3695
|
+
endpoint: '/api/v1/credits/consumption',
|
|
3696
|
+
httpMethod: 'post',
|
|
3697
|
+
summary: 'Consume credits',
|
|
3698
|
+
description:
|
|
3699
|
+
'Consumes a specified amount of credits directly from a customer wallet, with no feature mapping. Returns the optimistic balance.',
|
|
3700
|
+
stainlessPath: '(resource) v1.credits.consumption > (method) consume',
|
|
3701
|
+
qualified: 'client.v1.credits.consumption.consume',
|
|
3702
|
+
params: [
|
|
3703
|
+
'amount: number;',
|
|
3704
|
+
'currencyId: string;',
|
|
3705
|
+
'customerId: string;',
|
|
3706
|
+
'idempotencyKey: string;',
|
|
3707
|
+
'createdAt?: string;',
|
|
3708
|
+
'dimensions?: object;',
|
|
3709
|
+
'resourceId?: string;',
|
|
3710
|
+
'X-ACCOUNT-ID?: string;',
|
|
3711
|
+
'X-ENVIRONMENT-ID?: string;',
|
|
3712
|
+
],
|
|
3713
|
+
response:
|
|
3714
|
+
'{ data: { amount: number; currencyId: string; customerId: string; timestamp: string; credit?: { currencyId: string; currentUsage: number; timestamp: string; usageLimit: number; usagePeriodEnd?: string; }; resourceId?: string; }; }',
|
|
3715
|
+
markdown:
|
|
3716
|
+
"## consume\n\n`client.v1.credits.consumption.consume(amount: number, currencyId: string, customerId: string, idempotencyKey: string, createdAt?: string, dimensions?: object, resourceId?: string, X-ACCOUNT-ID?: string, X-ENVIRONMENT-ID?: string): { data: object; }`\n\n**post** `/api/v1/credits/consumption`\n\nConsumes a specified amount of credits directly from a customer wallet, with no feature mapping. Returns the optimistic balance.\n\n### Parameters\n\n- `amount: number`\n The amount of credits to consume\n\n- `currencyId: string`\n The credit currency to consume from (required)\n\n- `customerId: string`\n The customer to consume credits from (required)\n\n- `idempotencyKey: string`\n A unique key used to deduplicate the consumption (required)\n\n- `createdAt?: string`\n Optional timestamp the consumption is attributed to\n\n- `dimensions?: object`\n Optional dimensions describing the consumption\n\n- `resourceId?: string`\n Optional resource the consumption is attributed to\n\n- `X-ACCOUNT-ID?: string`\n\n- `X-ENVIRONMENT-ID?: string`\n\n### Returns\n\n- `{ data: { amount: number; currencyId: string; customerId: string; timestamp: string; credit?: { currencyId: string; currentUsage: number; timestamp: string; usageLimit: number; usagePeriodEnd?: string; }; resourceId?: string; }; }`\n Response object\n\n - `data: { amount: number; currencyId: string; customerId: string; timestamp: string; credit?: { currencyId: string; currentUsage: number; timestamp: string; usageLimit: number; usagePeriodEnd?: string; }; resourceId?: string; }`\n\n### Example\n\n```typescript\nimport Stigg from '@stigg/typescript';\n\nconst client = new Stigg();\n\nconst response = await client.v1.credits.consumption.consume({\n amount: 1,\n currencyId: 'currencyId',\n customerId: 'customerId',\n idempotencyKey: 'x',\n});\n\nconsole.log(response);\n```",
|
|
3717
|
+
perLanguage: {
|
|
3718
|
+
typescript: {
|
|
3719
|
+
method: 'client.v1.credits.consumption.consume',
|
|
3720
|
+
example:
|
|
3721
|
+
"import Stigg from '@stigg/typescript';\n\nconst client = new Stigg({\n apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.credits.consumption.consume({\n amount: 1,\n currencyId: 'currencyId',\n customerId: 'customerId',\n idempotencyKey: 'x',\n});\n\nconsole.log(response.data);",
|
|
3722
|
+
},
|
|
3723
|
+
python: {
|
|
3724
|
+
method: 'v1.credits.consumption.consume',
|
|
3725
|
+
example:
|
|
3726
|
+
'import os\nfrom stigg import Stigg\n\nclient = Stigg(\n api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.credits.consumption.consume(\n amount=1,\n currency_id="currencyId",\n customer_id="customerId",\n idempotency_key="x",\n)\nprint(response.data)',
|
|
3727
|
+
},
|
|
3728
|
+
java: {
|
|
3729
|
+
method: 'v1().credits().consumption().consume',
|
|
3730
|
+
example:
|
|
3731
|
+
'package io.stigg.example;\n\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport io.stigg.models.v1.credits.consumption.ConsumptionConsumeParams;\nimport io.stigg.models.v1.credits.consumption.ConsumptionConsumeResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n StiggClient client = StiggOkHttpClient.fromEnv();\n\n ConsumptionConsumeParams params = ConsumptionConsumeParams.builder()\n .amount(1.0)\n .currencyId("currencyId")\n .customerId("customerId")\n .idempotencyKey("x")\n .build();\n ConsumptionConsumeResponse response = client.v1().credits().consumption().consume(params);\n }\n}',
|
|
3732
|
+
},
|
|
3733
|
+
go: {
|
|
3734
|
+
method: 'client.V1.Credits.Consumption.Consume',
|
|
3735
|
+
example:
|
|
3736
|
+
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stiggio/stigg-go"\n\t"github.com/stiggio/stigg-go/option"\n)\n\nfunc main() {\n\tclient := stigg.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Credits.Consumption.Consume(context.TODO(), stigg.V1CreditConsumptionConsumeParams{\n\t\tAmount: 1,\n\t\tCurrencyID: "currencyId",\n\t\tCustomerID: "customerId",\n\t\tIdempotencyKey: "x",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n',
|
|
3737
|
+
},
|
|
3738
|
+
ruby: {
|
|
3739
|
+
method: 'v1.credits.consumption.consume',
|
|
3740
|
+
example:
|
|
3741
|
+
'require "stigg"\n\nstigg = Stigg::Client.new(api_key: "My API Key")\n\nresponse = stigg.v1.credits.consumption.consume(\n amount: 1,\n currency_id: "currencyId",\n customer_id: "customerId",\n idempotency_key: "x"\n)\n\nputs(response)',
|
|
3742
|
+
},
|
|
3743
|
+
cli: {
|
|
3744
|
+
method: 'consumption consume',
|
|
3745
|
+
example:
|
|
3746
|
+
"stigg v1:credits:consumption consume \\\n --api-key 'My API Key' \\\n --amount 1 \\\n --currency-id currencyId \\\n --customer-id customerId \\\n --idempotency-key x",
|
|
3747
|
+
},
|
|
3748
|
+
csharp: {
|
|
3749
|
+
method: 'V1.Credits.Consumption.Consume',
|
|
3750
|
+
example:
|
|
3751
|
+
'ConsumptionConsumeParams parameters = new()\n{\n Amount = 1,\n CurrencyID = "currencyId",\n CustomerID = "customerId",\n IdempotencyKey = "x",\n};\n\nvar response = await client.V1.Credits.Consumption.Consume(parameters);\n\nConsole.WriteLine(response);',
|
|
3752
|
+
},
|
|
3753
|
+
http: {
|
|
3754
|
+
example:
|
|
3755
|
+
'curl https://api.stigg.io/api/v1/credits/consumption \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "amount": 1,\n "currencyId": "currencyId",\n "customerId": "customerId",\n "idempotencyKey": "x"\n }\'',
|
|
3756
|
+
},
|
|
3757
|
+
},
|
|
3758
|
+
},
|
|
3759
|
+
{
|
|
3760
|
+
name: 'consume_async',
|
|
3761
|
+
endpoint: '/api/v1/credits/consumption/async',
|
|
3762
|
+
httpMethod: 'post',
|
|
3763
|
+
summary: 'Consume credits asynchronously',
|
|
3764
|
+
description:
|
|
3765
|
+
'Consumes credits directly from customer wallets asynchronously. Consumptions are reconciled asynchronously into the credit balances.',
|
|
3766
|
+
stainlessPath: '(resource) v1.credits.consumption > (method) consume_async',
|
|
3767
|
+
qualified: 'client.v1.credits.consumption.consumeAsync',
|
|
3768
|
+
params: [
|
|
3769
|
+
'consumptions: { amount: number; currencyId: string; customerId: string; idempotencyKey: string; createdAt?: string; dimensions?: object; resourceId?: string; }[];',
|
|
3770
|
+
'X-ACCOUNT-ID?: string;',
|
|
3771
|
+
'X-ENVIRONMENT-ID?: string;',
|
|
3772
|
+
],
|
|
3773
|
+
response: '{ data: object; }',
|
|
3774
|
+
markdown:
|
|
3775
|
+
"## consume_async\n\n`client.v1.credits.consumption.consumeAsync(consumptions: { amount: number; currencyId: string; customerId: string; idempotencyKey: string; createdAt?: string; dimensions?: object; resourceId?: string; }[], X-ACCOUNT-ID?: string, X-ENVIRONMENT-ID?: string): { data: object; }`\n\n**post** `/api/v1/credits/consumption/async`\n\nConsumes credits directly from customer wallets asynchronously. Consumptions are reconciled asynchronously into the credit balances.\n\n### Parameters\n\n- `consumptions: { amount: number; currencyId: string; customerId: string; idempotencyKey: string; createdAt?: string; dimensions?: object; resourceId?: string; }[]`\n The credit consumptions to report (up to 1000)\n\n- `X-ACCOUNT-ID?: string`\n\n- `X-ENVIRONMENT-ID?: string`\n\n### Returns\n\n- `{ data: object; }`\n Response object\n\n - `data: object`\n\n### Example\n\n```typescript\nimport Stigg from '@stigg/typescript';\n\nconst client = new Stigg();\n\nconst response = await client.v1.credits.consumption.consumeAsync({ consumptions: [{\n amount: 1,\n currencyId: 'currencyId',\n customerId: 'customerId',\n idempotencyKey: 'x',\n}] });\n\nconsole.log(response);\n```",
|
|
3776
|
+
perLanguage: {
|
|
3777
|
+
typescript: {
|
|
3778
|
+
method: 'client.v1.credits.consumption.consumeAsync',
|
|
3779
|
+
example:
|
|
3780
|
+
"import Stigg from '@stigg/typescript';\n\nconst client = new Stigg({\n apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.credits.consumption.consumeAsync({\n consumptions: [\n {\n amount: 1,\n currencyId: 'currencyId',\n customerId: 'customerId',\n idempotencyKey: 'x',\n },\n ],\n});\n\nconsole.log(response.data);",
|
|
3781
|
+
},
|
|
3782
|
+
python: {
|
|
3783
|
+
method: 'v1.credits.consumption.consume_async',
|
|
3784
|
+
example:
|
|
3785
|
+
'import os\nfrom stigg import Stigg\n\nclient = Stigg(\n api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.credits.consumption.consume_async(\n consumptions=[{\n "amount": 1,\n "currency_id": "currencyId",\n "customer_id": "customerId",\n "idempotency_key": "x",\n }],\n)\nprint(response.data)',
|
|
3786
|
+
},
|
|
3787
|
+
java: {
|
|
3788
|
+
method: 'v1().credits().consumption().consumeAsync',
|
|
3789
|
+
example:
|
|
3790
|
+
'package io.stigg.example;\n\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport io.stigg.models.v1.credits.consumption.ConsumptionConsumeAsyncParams;\nimport io.stigg.models.v1.credits.consumption.ConsumptionConsumeAsyncResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n StiggClient client = StiggOkHttpClient.fromEnv();\n\n ConsumptionConsumeAsyncParams params = ConsumptionConsumeAsyncParams.builder()\n .addConsumption(ConsumptionConsumeAsyncParams.Consumption.builder()\n .amount(1.0)\n .currencyId("currencyId")\n .customerId("customerId")\n .idempotencyKey("x")\n .build())\n .build();\n ConsumptionConsumeAsyncResponse response = client.v1().credits().consumption().consumeAsync(params);\n }\n}',
|
|
3791
|
+
},
|
|
3792
|
+
go: {
|
|
3793
|
+
method: 'client.V1.Credits.Consumption.ConsumeAsync',
|
|
3794
|
+
example:
|
|
3795
|
+
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stiggio/stigg-go"\n\t"github.com/stiggio/stigg-go/option"\n)\n\nfunc main() {\n\tclient := stigg.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Credits.Consumption.ConsumeAsync(context.TODO(), stigg.V1CreditConsumptionConsumeAsyncParams{\n\t\tConsumptions: []stigg.V1CreditConsumptionConsumeAsyncParamsConsumption{{\n\t\t\tAmount: 1,\n\t\t\tCurrencyID: "currencyId",\n\t\t\tCustomerID: "customerId",\n\t\t\tIdempotencyKey: "x",\n\t\t}},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n',
|
|
3796
|
+
},
|
|
3797
|
+
ruby: {
|
|
3798
|
+
method: 'v1.credits.consumption.consume_async',
|
|
3799
|
+
example:
|
|
3800
|
+
'require "stigg"\n\nstigg = Stigg::Client.new(api_key: "My API Key")\n\nresponse = stigg.v1.credits.consumption.consume_async(\n consumptions: [{amount: 1, currencyId: "currencyId", customerId: "customerId", idempotencyKey: "x"}]\n)\n\nputs(response)',
|
|
3801
|
+
},
|
|
3802
|
+
cli: {
|
|
3803
|
+
method: 'consumption consume_async',
|
|
3804
|
+
example:
|
|
3805
|
+
"stigg v1:credits:consumption consume-async \\\n --api-key 'My API Key' \\\n --consumption '{amount: 1, currencyId: currencyId, customerId: customerId, idempotencyKey: x}'",
|
|
3806
|
+
},
|
|
3807
|
+
csharp: {
|
|
3808
|
+
method: 'V1.Credits.Consumption.ConsumeAsync',
|
|
3809
|
+
example:
|
|
3810
|
+
'ConsumptionConsumeAsyncParams parameters = new()\n{\n Consumptions =\n [\n new()\n {\n Amount = 1,\n CurrencyID = "currencyId",\n CustomerID = "customerId",\n IdempotencyKey = "x",\n CreatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),\n Dimensions = new Dictionary<string, Dimension>()\n {\n { "foo", "string" }\n },\n ResourceID = "resourceId",\n },\n ],\n};\n\nvar response = await client.V1.Credits.Consumption.ConsumeAsync(parameters);\n\nConsole.WriteLine(response);',
|
|
3811
|
+
},
|
|
3812
|
+
http: {
|
|
3813
|
+
example:
|
|
3814
|
+
'curl https://api.stigg.io/api/v1/credits/consumption/async \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "consumptions": [\n {\n "amount": 1,\n "currencyId": "currencyId",\n "customerId": "customerId",\n "idempotencyKey": "x"\n }\n ]\n }\'',
|
|
3694
3815
|
},
|
|
3695
3816
|
},
|
|
3696
3817
|
},
|
|
@@ -3743,7 +3864,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3743
3864
|
'FeatureRetrieveFeatureParams parameters = new() { ID = "x" };\n\nvar feature = await client.V1.Features.RetrieveFeature(parameters);\n\nConsole.WriteLine(feature);',
|
|
3744
3865
|
},
|
|
3745
3866
|
http: {
|
|
3746
|
-
example: 'curl https://
|
|
3867
|
+
example: 'curl https://api.stigg.io/api/v1/features/$ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3747
3868
|
},
|
|
3748
3869
|
},
|
|
3749
3870
|
},
|
|
@@ -3810,7 +3931,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3810
3931
|
},
|
|
3811
3932
|
http: {
|
|
3812
3933
|
example:
|
|
3813
|
-
"curl https://
|
|
3934
|
+
"curl https://api.stigg.io/api/v1/features/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"X-API-KEY: $STIGG_API_KEY\" \\\n -d '{}'",
|
|
3814
3935
|
},
|
|
3815
3936
|
},
|
|
3816
3937
|
},
|
|
@@ -3879,7 +4000,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3879
4000
|
},
|
|
3880
4001
|
http: {
|
|
3881
4002
|
example:
|
|
3882
|
-
'curl https://
|
|
4003
|
+
'curl https://api.stigg.io/api/v1/features \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "id": "id",\n "displayName": "displayName",\n "featureType": "BOOLEAN"\n }\'',
|
|
3883
4004
|
},
|
|
3884
4005
|
},
|
|
3885
4006
|
},
|
|
@@ -3943,7 +4064,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3943
4064
|
'FeatureListFeaturesParams parameters = new();\n\nvar page = await client.V1.Features.ListFeatures(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
3944
4065
|
},
|
|
3945
4066
|
http: {
|
|
3946
|
-
example: 'curl https://
|
|
4067
|
+
example: 'curl https://api.stigg.io/api/v1/features \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3947
4068
|
},
|
|
3948
4069
|
},
|
|
3949
4070
|
},
|
|
@@ -3997,7 +4118,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
3997
4118
|
},
|
|
3998
4119
|
http: {
|
|
3999
4120
|
example:
|
|
4000
|
-
'curl https://
|
|
4121
|
+
'curl https://api.stigg.io/api/v1/features/$ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4001
4122
|
},
|
|
4002
4123
|
},
|
|
4003
4124
|
},
|
|
@@ -4051,7 +4172,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4051
4172
|
},
|
|
4052
4173
|
http: {
|
|
4053
4174
|
example:
|
|
4054
|
-
'curl https://
|
|
4175
|
+
'curl https://api.stigg.io/api/v1/features/$ID/unarchive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4055
4176
|
},
|
|
4056
4177
|
},
|
|
4057
4178
|
},
|
|
@@ -4113,7 +4234,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4113
4234
|
'AddonListParams parameters = new();\n\nvar page = await client.V1.Addons.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
4114
4235
|
},
|
|
4115
4236
|
http: {
|
|
4116
|
-
example: 'curl https://
|
|
4237
|
+
example: 'curl https://api.stigg.io/api/v1/addons \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4117
4238
|
},
|
|
4118
4239
|
},
|
|
4119
4240
|
},
|
|
@@ -4180,7 +4301,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4180
4301
|
},
|
|
4181
4302
|
http: {
|
|
4182
4303
|
example:
|
|
4183
|
-
'curl https://
|
|
4304
|
+
'curl https://api.stigg.io/api/v1/addons \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "id": "id",\n "displayName": "displayName",\n "productId": "productId"\n }\'',
|
|
4184
4305
|
},
|
|
4185
4306
|
},
|
|
4186
4307
|
},
|
|
@@ -4233,7 +4354,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4233
4354
|
'AddonRetrieveParams parameters = new() { ID = "x" };\n\nvar addon = await client.V1.Addons.Retrieve(parameters);\n\nConsole.WriteLine(addon);',
|
|
4234
4355
|
},
|
|
4235
4356
|
http: {
|
|
4236
|
-
example: 'curl https://
|
|
4357
|
+
example: 'curl https://api.stigg.io/api/v1/addons/$ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4237
4358
|
},
|
|
4238
4359
|
},
|
|
4239
4360
|
},
|
|
@@ -4299,7 +4420,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4299
4420
|
},
|
|
4300
4421
|
http: {
|
|
4301
4422
|
example:
|
|
4302
|
-
"curl https://
|
|
4423
|
+
"curl https://api.stigg.io/api/v1/addons/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"X-API-KEY: $STIGG_API_KEY\" \\\n -d '{}'",
|
|
4303
4424
|
},
|
|
4304
4425
|
},
|
|
4305
4426
|
},
|
|
@@ -4353,7 +4474,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4353
4474
|
},
|
|
4354
4475
|
http: {
|
|
4355
4476
|
example:
|
|
4356
|
-
'curl https://
|
|
4477
|
+
'curl https://api.stigg.io/api/v1/addons/$ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4357
4478
|
},
|
|
4358
4479
|
},
|
|
4359
4480
|
},
|
|
@@ -4412,7 +4533,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4412
4533
|
},
|
|
4413
4534
|
http: {
|
|
4414
4535
|
example:
|
|
4415
|
-
'curl https://
|
|
4536
|
+
'curl https://api.stigg.io/api/v1/addons/$ID/publish \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "migrationType": "NEW_CUSTOMERS"\n }\'',
|
|
4416
4537
|
},
|
|
4417
4538
|
},
|
|
4418
4539
|
},
|
|
@@ -4466,7 +4587,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4466
4587
|
},
|
|
4467
4588
|
http: {
|
|
4468
4589
|
example:
|
|
4469
|
-
'curl https://
|
|
4590
|
+
'curl https://api.stigg.io/api/v1/addons/$ID/draft \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4470
4591
|
},
|
|
4471
4592
|
},
|
|
4472
4593
|
},
|
|
@@ -4519,7 +4640,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4519
4640
|
},
|
|
4520
4641
|
http: {
|
|
4521
4642
|
example:
|
|
4522
|
-
'curl https://
|
|
4643
|
+
'curl https://api.stigg.io/api/v1/addons/$ID/draft \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4523
4644
|
},
|
|
4524
4645
|
},
|
|
4525
4646
|
},
|
|
@@ -4579,8 +4700,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4579
4700
|
'AddonListChargesParams parameters = new() { ID = "x" };\n\nvar page = await client.V1.Addons.ListCharges(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
4580
4701
|
},
|
|
4581
4702
|
http: {
|
|
4582
|
-
example:
|
|
4583
|
-
'curl https://edge.api.stigg.io/api/v1/addons/$ID/charges \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4703
|
+
example: 'curl https://api.stigg.io/api/v1/addons/$ID/charges \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4584
4704
|
},
|
|
4585
4705
|
},
|
|
4586
4706
|
},
|
|
@@ -4634,7 +4754,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4634
4754
|
},
|
|
4635
4755
|
http: {
|
|
4636
4756
|
example:
|
|
4637
|
-
'curl https://
|
|
4757
|
+
'curl https://api.stigg.io/api/v1/addons/$ADDON_ID/entitlements \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4638
4758
|
},
|
|
4639
4759
|
},
|
|
4640
4760
|
},
|
|
@@ -4694,7 +4814,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4694
4814
|
},
|
|
4695
4815
|
http: {
|
|
4696
4816
|
example:
|
|
4697
|
-
'curl https://
|
|
4817
|
+
'curl https://api.stigg.io/api/v1/addons/$ADDON_ID/entitlements \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "entitlements": [\n {\n "id": "id",\n "type": "FEATURE"\n }\n ]\n }\'',
|
|
4698
4818
|
},
|
|
4699
4819
|
},
|
|
4700
4820
|
},
|
|
@@ -4753,7 +4873,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4753
4873
|
},
|
|
4754
4874
|
http: {
|
|
4755
4875
|
example:
|
|
4756
|
-
'curl https://
|
|
4876
|
+
'curl https://api.stigg.io/api/v1/addons/$ADDON_ID/entitlements/$ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "type": "FEATURE"\n }\'',
|
|
4757
4877
|
},
|
|
4758
4878
|
},
|
|
4759
4879
|
},
|
|
@@ -4808,7 +4928,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4808
4928
|
},
|
|
4809
4929
|
http: {
|
|
4810
4930
|
example:
|
|
4811
|
-
'curl https://
|
|
4931
|
+
'curl https://api.stigg.io/api/v1/addons/$ADDON_ID/entitlements/$ID \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4812
4932
|
},
|
|
4813
4933
|
},
|
|
4814
4934
|
},
|
|
@@ -4876,7 +4996,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4876
4996
|
},
|
|
4877
4997
|
http: {
|
|
4878
4998
|
example:
|
|
4879
|
-
'curl https://
|
|
4999
|
+
'curl https://api.stigg.io/api/v1/plans \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "id": "id",\n "displayName": "displayName",\n "productId": "productId"\n }\'',
|
|
4880
5000
|
},
|
|
4881
5001
|
},
|
|
4882
5002
|
},
|
|
@@ -4938,7 +5058,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4938
5058
|
'PlanListParams parameters = new();\n\nvar page = await client.V1.Plans.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
4939
5059
|
},
|
|
4940
5060
|
http: {
|
|
4941
|
-
example: 'curl https://
|
|
5061
|
+
example: 'curl https://api.stigg.io/api/v1/plans \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4942
5062
|
},
|
|
4943
5063
|
},
|
|
4944
5064
|
},
|
|
@@ -4991,7 +5111,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
4991
5111
|
'PlanRetrieveParams parameters = new() { ID = "x" };\n\nvar plan = await client.V1.Plans.Retrieve(parameters);\n\nConsole.WriteLine(plan);',
|
|
4992
5112
|
},
|
|
4993
5113
|
http: {
|
|
4994
|
-
example: 'curl https://
|
|
5114
|
+
example: 'curl https://api.stigg.io/api/v1/plans/$ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4995
5115
|
},
|
|
4996
5116
|
},
|
|
4997
5117
|
},
|
|
@@ -5057,7 +5177,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5057
5177
|
},
|
|
5058
5178
|
http: {
|
|
5059
5179
|
example:
|
|
5060
|
-
"curl https://
|
|
5180
|
+
"curl https://api.stigg.io/api/v1/plans/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"X-API-KEY: $STIGG_API_KEY\" \\\n -d '{}'",
|
|
5061
5181
|
},
|
|
5062
5182
|
},
|
|
5063
5183
|
},
|
|
@@ -5111,7 +5231,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5111
5231
|
},
|
|
5112
5232
|
http: {
|
|
5113
5233
|
example:
|
|
5114
|
-
'curl https://
|
|
5234
|
+
'curl https://api.stigg.io/api/v1/plans/$ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5115
5235
|
},
|
|
5116
5236
|
},
|
|
5117
5237
|
},
|
|
@@ -5170,7 +5290,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5170
5290
|
},
|
|
5171
5291
|
http: {
|
|
5172
5292
|
example:
|
|
5173
|
-
'curl https://
|
|
5293
|
+
'curl https://api.stigg.io/api/v1/plans/$ID/publish \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "migrationType": "NEW_CUSTOMERS"\n }\'',
|
|
5174
5294
|
},
|
|
5175
5295
|
},
|
|
5176
5296
|
},
|
|
@@ -5224,7 +5344,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5224
5344
|
},
|
|
5225
5345
|
http: {
|
|
5226
5346
|
example:
|
|
5227
|
-
'curl https://
|
|
5347
|
+
'curl https://api.stigg.io/api/v1/plans/$ID/draft \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5228
5348
|
},
|
|
5229
5349
|
},
|
|
5230
5350
|
},
|
|
@@ -5277,7 +5397,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5277
5397
|
},
|
|
5278
5398
|
http: {
|
|
5279
5399
|
example:
|
|
5280
|
-
'curl https://
|
|
5400
|
+
'curl https://api.stigg.io/api/v1/plans/$ID/draft \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5281
5401
|
},
|
|
5282
5402
|
},
|
|
5283
5403
|
},
|
|
@@ -5337,8 +5457,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5337
5457
|
'PlanListChargesParams parameters = new() { ID = "x" };\n\nvar page = await client.V1.Plans.ListCharges(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
5338
5458
|
},
|
|
5339
5459
|
http: {
|
|
5340
|
-
example:
|
|
5341
|
-
'curl https://edge.api.stigg.io/api/v1/plans/$ID/charges \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5460
|
+
example: 'curl https://api.stigg.io/api/v1/plans/$ID/charges \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5342
5461
|
},
|
|
5343
5462
|
},
|
|
5344
5463
|
},
|
|
@@ -5399,7 +5518,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5399
5518
|
},
|
|
5400
5519
|
http: {
|
|
5401
5520
|
example:
|
|
5402
|
-
'curl https://
|
|
5521
|
+
'curl https://api.stigg.io/api/v1/plans/$ID/overage-charges \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5403
5522
|
},
|
|
5404
5523
|
},
|
|
5405
5524
|
},
|
|
@@ -5453,7 +5572,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5453
5572
|
},
|
|
5454
5573
|
http: {
|
|
5455
5574
|
example:
|
|
5456
|
-
'curl https://
|
|
5575
|
+
'curl https://api.stigg.io/api/v1/plans/$PLAN_ID/entitlements \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5457
5576
|
},
|
|
5458
5577
|
},
|
|
5459
5578
|
},
|
|
@@ -5513,7 +5632,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5513
5632
|
},
|
|
5514
5633
|
http: {
|
|
5515
5634
|
example:
|
|
5516
|
-
'curl https://
|
|
5635
|
+
'curl https://api.stigg.io/api/v1/plans/$PLAN_ID/entitlements \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "entitlements": [\n {\n "id": "id",\n "type": "FEATURE"\n }\n ]\n }\'',
|
|
5517
5636
|
},
|
|
5518
5637
|
},
|
|
5519
5638
|
},
|
|
@@ -5572,7 +5691,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5572
5691
|
},
|
|
5573
5692
|
http: {
|
|
5574
5693
|
example:
|
|
5575
|
-
'curl https://
|
|
5694
|
+
'curl https://api.stigg.io/api/v1/plans/$PLAN_ID/entitlements/$ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "type": "FEATURE"\n }\'',
|
|
5576
5695
|
},
|
|
5577
5696
|
},
|
|
5578
5697
|
},
|
|
@@ -5627,7 +5746,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5627
5746
|
},
|
|
5628
5747
|
http: {
|
|
5629
5748
|
example:
|
|
5630
|
-
'curl https://
|
|
5749
|
+
'curl https://api.stigg.io/api/v1/plans/$PLAN_ID/entitlements/$ID \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5631
5750
|
},
|
|
5632
5751
|
},
|
|
5633
5752
|
},
|
|
@@ -5687,7 +5806,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5687
5806
|
},
|
|
5688
5807
|
http: {
|
|
5689
5808
|
example:
|
|
5690
|
-
'curl https://
|
|
5809
|
+
'curl https://api.stigg.io/api/v1/usage \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "usages": [\n {\n "customerId": "customerId",\n "featureId": "featureId",\n "value": -9007199254740991\n }\n ]\n }\'',
|
|
5691
5810
|
},
|
|
5692
5811
|
},
|
|
5693
5812
|
},
|
|
@@ -5751,7 +5870,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5751
5870
|
},
|
|
5752
5871
|
http: {
|
|
5753
5872
|
example:
|
|
5754
|
-
'curl https://
|
|
5873
|
+
'curl https://api.stigg.io/api/v1/usage/$CUSTOMER_ID/history/$FEATURE_ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5755
5874
|
},
|
|
5756
5875
|
},
|
|
5757
5876
|
},
|
|
@@ -5813,7 +5932,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5813
5932
|
'ProductListProductsParams parameters = new();\n\nvar page = await client.V1.Products.ListProducts(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
5814
5933
|
},
|
|
5815
5934
|
http: {
|
|
5816
|
-
example: 'curl https://
|
|
5935
|
+
example: 'curl https://api.stigg.io/api/v1/products \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5817
5936
|
},
|
|
5818
5937
|
},
|
|
5819
5938
|
},
|
|
@@ -5876,7 +5995,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5876
5995
|
},
|
|
5877
5996
|
http: {
|
|
5878
5997
|
example:
|
|
5879
|
-
'curl https://
|
|
5998
|
+
'curl https://api.stigg.io/api/v1/products \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "id": "id",\n "displayName": "displayName"\n }\'',
|
|
5880
5999
|
},
|
|
5881
6000
|
},
|
|
5882
6001
|
},
|
|
@@ -5940,7 +6059,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5940
6059
|
},
|
|
5941
6060
|
http: {
|
|
5942
6061
|
example:
|
|
5943
|
-
"curl https://
|
|
6062
|
+
"curl https://api.stigg.io/api/v1/products/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"X-API-KEY: $STIGG_API_KEY\" \\\n -d '{}'",
|
|
5944
6063
|
},
|
|
5945
6064
|
},
|
|
5946
6065
|
},
|
|
@@ -5994,7 +6113,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
5994
6113
|
},
|
|
5995
6114
|
http: {
|
|
5996
6115
|
example:
|
|
5997
|
-
'curl https://
|
|
6116
|
+
'curl https://api.stigg.io/api/v1/products/$ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5998
6117
|
},
|
|
5999
6118
|
},
|
|
6000
6119
|
},
|
|
@@ -6048,7 +6167,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
6048
6167
|
},
|
|
6049
6168
|
http: {
|
|
6050
6169
|
example:
|
|
6051
|
-
'curl https://
|
|
6170
|
+
'curl https://api.stigg.io/api/v1/products/$ID/unarchive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
6052
6171
|
},
|
|
6053
6172
|
},
|
|
6054
6173
|
},
|
|
@@ -6110,7 +6229,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
6110
6229
|
},
|
|
6111
6230
|
http: {
|
|
6112
6231
|
example:
|
|
6113
|
-
'curl https://
|
|
6232
|
+
'curl https://api.stigg.io/api/v1/products/$ID/duplicate \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "targetId": "targetId"\n }\'',
|
|
6114
6233
|
},
|
|
6115
6234
|
},
|
|
6116
6235
|
},
|
|
@@ -6175,7 +6294,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
6175
6294
|
},
|
|
6176
6295
|
http: {
|
|
6177
6296
|
example:
|
|
6178
|
-
'curl https://
|
|
6297
|
+
'curl https://api.stigg.io/api/v1-beta/customers/$ID/entitlements/check \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
6179
6298
|
},
|
|
6180
6299
|
},
|
|
6181
6300
|
},
|
|
@@ -6238,7 +6357,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
6238
6357
|
},
|
|
6239
6358
|
http: {
|
|
6240
6359
|
example:
|
|
6241
|
-
'curl https://
|
|
6360
|
+
'curl https://api.stigg.io/api/v1-beta/customers/$ID/entities \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
6242
6361
|
},
|
|
6243
6362
|
},
|
|
6244
6363
|
},
|
|
@@ -6299,7 +6418,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
6299
6418
|
},
|
|
6300
6419
|
http: {
|
|
6301
6420
|
example:
|
|
6302
|
-
'curl https://
|
|
6421
|
+
'curl https://api.stigg.io/api/v1-beta/customers/$ID/entities \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "entities": [\n {\n "id": "user-7f3a0c1d",\n "metadata": {\n "email": "jane@acme.com",\n "role": "admin"\n },\n "typeRefId": "user"\n },\n {\n "id": "user-c4d1b2e9",\n "metadata": {\n "email": "john@acme.com"\n },\n "typeRefId": "user"\n }\n ]\n }\'',
|
|
6303
6422
|
},
|
|
6304
6423
|
},
|
|
6305
6424
|
},
|
|
@@ -6354,7 +6473,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
6354
6473
|
},
|
|
6355
6474
|
http: {
|
|
6356
6475
|
example:
|
|
6357
|
-
'curl https://
|
|
6476
|
+
'curl https://api.stigg.io/api/v1-beta/customers/$ID/entities/$ENTITY_ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
6358
6477
|
},
|
|
6359
6478
|
},
|
|
6360
6479
|
},
|
|
@@ -6408,7 +6527,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
6408
6527
|
},
|
|
6409
6528
|
http: {
|
|
6410
6529
|
example:
|
|
6411
|
-
'curl https://
|
|
6530
|
+
'curl https://api.stigg.io/api/v1-beta/customers/$ID/entities/archive \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "ids": [\n "user-7f3a0c1d",\n "user-c4d1b2e9"\n ]\n }\'',
|
|
6412
6531
|
},
|
|
6413
6532
|
},
|
|
6414
6533
|
},
|
|
@@ -6462,7 +6581,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
6462
6581
|
},
|
|
6463
6582
|
http: {
|
|
6464
6583
|
example:
|
|
6465
|
-
'curl https://
|
|
6584
|
+
'curl https://api.stigg.io/api/v1-beta/customers/$ID/entities/unarchive \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "ids": [\n "user-7f3a0c1d",\n "user-c4d1b2e9"\n ]\n }\'',
|
|
6466
6585
|
},
|
|
6467
6586
|
},
|
|
6468
6587
|
},
|
|
@@ -6526,7 +6645,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
6526
6645
|
},
|
|
6527
6646
|
http: {
|
|
6528
6647
|
example:
|
|
6529
|
-
'curl https://
|
|
6648
|
+
'curl https://api.stigg.io/api/v1-beta/customers/$ID/assignments \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
6530
6649
|
},
|
|
6531
6650
|
},
|
|
6532
6651
|
},
|
|
@@ -6587,7 +6706,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
6587
6706
|
},
|
|
6588
6707
|
http: {
|
|
6589
6708
|
example:
|
|
6590
|
-
'curl https://
|
|
6709
|
+
'curl https://api.stigg.io/api/v1-beta/customers/$ID/assignments \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "assignments": [\n {\n "entityId": "workspace-001",\n "cadence": "P1M",\n "featureId": "compute-minutes",\n "usageLimit": 1000\n },\n {\n "entityId": "workspace-002",\n "cadence": "P1M",\n "currencyId": "cred-type-tokens",\n "parentId": "workspace-001",\n "scopeEntityIds": [\n "user-1"\n ],\n "usageLimit": 2000\n }\n ]\n }\'',
|
|
6591
6710
|
},
|
|
6592
6711
|
},
|
|
6593
6712
|
},
|
|
@@ -6647,8 +6766,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
6647
6766
|
'EntityTypeListParams parameters = new();\n\nvar page = await client.V1Beta.EntityTypes.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
6648
6767
|
},
|
|
6649
6768
|
http: {
|
|
6650
|
-
example:
|
|
6651
|
-
'curl https://edge.api.stigg.io/api/v1-beta/entity-types \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
6769
|
+
example: 'curl https://api.stigg.io/api/v1-beta/entity-types \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
6652
6770
|
},
|
|
6653
6771
|
},
|
|
6654
6772
|
},
|
|
@@ -6708,7 +6826,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
6708
6826
|
},
|
|
6709
6827
|
http: {
|
|
6710
6828
|
example:
|
|
6711
|
-
'curl https://
|
|
6829
|
+
'curl https://api.stigg.io/api/v1-beta/entity-types \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "types": [\n {\n "id": "org",\n "attributionKeys": [\n "organizationId"\n ],\n "displayName": "Organization"\n },\n {\n "id": "team",\n "attributionKeys": [\n "teamId"\n ],\n "displayName": "Team"\n }\n ]\n }\'',
|
|
6712
6830
|
},
|
|
6713
6831
|
},
|
|
6714
6832
|
},
|
|
@@ -6733,7 +6851,7 @@ const EMBEDDED_READMES: { language: string; content: string }[] = [
|
|
|
6733
6851
|
{
|
|
6734
6852
|
language: 'java',
|
|
6735
6853
|
content:
|
|
6736
|
-
'# Stigg Java API Library\n\n<!-- x-release-please-start-version -->\n[](https://central.sonatype.com/artifact/io.stigg/stigg-java/0.0.1)\n[](https://javadoc.io/doc/io.stigg/stigg-java/0.0.1)\n<!-- x-release-please-end -->\n\nThe Stigg Java SDK provides convenient access to the Stigg REST API from applications written in Java.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Stigg MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40stigg%2Ftypescript-mcp&config=eyJuYW1lIjoiQHN0aWdnL3R5cGVzY3JpcHQtbWNwIiwidHJhbnNwb3J0IjoiaHR0cCIsInVybCI6Imh0dHBzOi8vc3RpZ2ctbWNwLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IlgtQVBJLUtFWSI6Ik15IEFQSSBLZXkifX0)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40stigg%2Ftypescript-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fstigg-mcp.stlmcp.com%22%2C%22headers%22%3A%7B%22X-API-KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n<!-- x-release-please-start-version -->\n\nJavadocs are available on [javadoc.io](https://javadoc.io/doc/io.stigg/stigg-java/0.0.1).\n\n<!-- x-release-please-end -->\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n### Gradle\n\n~~~kotlin\nimplementation("io.stigg:stigg-java:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n<dependency>\n <groupId>io.stigg</groupId>\n <artifactId>stigg-java</artifactId>\n <version>0.0.1</version>\n</dependency>\n~~~\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport io.stigg.models.v1.customers.CustomerResponse;\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\n\n// Configures using the `stigg.apiKey` and `stigg.baseUrl` system properties\n// Or configures using the `STIGG_API_KEY` and `STIGG_BASE_URL` environment variables\nStiggClient client = StiggOkHttpClient.fromEnv();\n\nCustomerResponse customerResponse = client.v1().customers().retrieve("REPLACE_ME");\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\n\n// Configures using the `stigg.apiKey` and `stigg.baseUrl` system properties\n// Or configures using the `STIGG_API_KEY` and `STIGG_BASE_URL` environment variables\nStiggClient client = StiggOkHttpClient.fromEnv();\n```\n\nOr manually:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\n\nStiggClient client = StiggOkHttpClient.builder()\n .apiKey("My API Key")\n .build();\n```\n\nOr using a combination of the two approaches:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\n\nStiggClient client = StiggOkHttpClient.builder()\n // Configures using the `stigg.apiKey` and `stigg.baseUrl` system properties\n // Or configures using the `STIGG_API_KEY` and `STIGG_BASE_URL` environment variables\n .fromEnv()\n .apiKey("My API Key")\n .build();\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------- | --------------- | -------------------- | -------- | ----------------------------- |\n| `apiKey` | `stigg.apiKey` | `STIGG_API_KEY` | true | - |\n| `baseUrl` | `stigg.baseUrl` | `STIGG_BASE_URL` | true | `"https://edge.api.stigg.io"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```java\nimport io.stigg.client.StiggClient;\n\nStiggClient clientWithOptions = client.withOptions(optionsBuilder -> {\n optionsBuilder.baseUrl("https://example.com");\n optionsBuilder.maxRetries(42);\n});\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Stigg API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.\n\nFor example, `client.v1().customers().retrieve(...)` should be called with an instance of `CustomerRetrieveParams`, and it will return an instance of `CustomerResponse`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport io.stigg.models.v1.customers.CustomerResponse;\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `stigg.apiKey` and `stigg.baseUrl` system properties\n// Or configures using the `STIGG_API_KEY` and `STIGG_BASE_URL` environment variables\nStiggClient client = StiggOkHttpClient.fromEnv();\n\nCompletableFuture<CustomerResponse> customerResponse = client.async().v1().customers().retrieve("REPLACE_ME");\n```\n\nOr create an asynchronous client from the beginning:\n\n```java\nimport io.stigg.client.StiggClientAsync;\nimport io.stigg.client.okhttp.StiggOkHttpClientAsync;\nimport io.stigg.models.v1.customers.CustomerResponse;\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `stigg.apiKey` and `stigg.baseUrl` system properties\n// Or configures using the `STIGG_API_KEY` and `STIGG_BASE_URL` environment variables\nStiggClientAsync client = StiggOkHttpClientAsync.fromEnv();\n\nCompletableFuture<CustomerResponse> customerResponse = client.v1().customers().retrieve("REPLACE_ME");\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.\n\n\n\n\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Java classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```java\nimport io.stigg.core.http.Headers;\nimport io.stigg.core.http.HttpResponseFor;\nimport io.stigg.models.v1.customers.CustomerResponse;\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\n\nHttpResponseFor<CustomerResponse> customerResponse = client.v1().customers().withRawResponse().retrieve("REPLACE_ME");\n\nint statusCode = customerResponse.statusCode();\nHeaders headers = customerResponse.headers();\n```\n\nYou can still deserialize the response into an instance of a Java class if needed:\n\n```java\nimport io.stigg.models.v1.customers.CustomerResponse;\n\nCustomerResponse parsedCustomerResponse = customerResponse.parse();\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`StiggServiceException`](stigg-java-core/src/main/kotlin/io/stigg/errors/StiggServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](stigg-java-core/src/main/kotlin/io/stigg/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](stigg-java-core/src/main/kotlin/io/stigg/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](stigg-java-core/src/main/kotlin/io/stigg/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](stigg-java-core/src/main/kotlin/io/stigg/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](stigg-java-core/src/main/kotlin/io/stigg/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](stigg-java-core/src/main/kotlin/io/stigg/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](stigg-java-core/src/main/kotlin/io/stigg/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](stigg-java-core/src/main/kotlin/io/stigg/errors/UnexpectedStatusCodeException.kt) |\n\n- [`StiggIoException`](stigg-java-core/src/main/kotlin/io/stigg/errors/StiggIoException.kt): I/O networking errors.\n\n- [`StiggRetryableException`](stigg-java-core/src/main/kotlin/io/stigg/errors/StiggRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`StiggInvalidDataException`](stigg-java-core/src/main/kotlin/io/stigg/errors/StiggInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`StiggException`](stigg-java-core/src/main/kotlin/io/stigg/errors/StiggException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n## Pagination\n\nThe SDK defines methods that return a paginated lists of results. It provides convenient ways to access the results either one page at a time or item-by-item across all pages.\n\n### Auto-pagination\n\nTo iterate through all results across all pages, use the `autoPager()` method, which automatically fetches more pages as needed.\n\nWhen using the synchronous client, the method returns an [`Iterable`](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html)\n\n```java\nimport io.stigg.models.v1.customers.CustomerListPage;\nimport io.stigg.models.v1.customers.CustomerListResponse;\n\nCustomerListPage page = client.v1().customers().list();\n\n// Process as an Iterable\nfor (CustomerListResponse customer : page.autoPager()) {\n System.out.println(customer);\n}\n\n// Process as a Stream\npage.autoPager()\n .stream()\n .limit(50)\n .forEach(customer -> System.out.println(customer));\n```\n\nWhen using the asynchronous client, the method returns an [`AsyncStreamResponse`](stigg-java-core/src/main/kotlin/io/stigg/core/http/AsyncStreamResponse.kt):\n\n```java\nimport io.stigg.core.http.AsyncStreamResponse;\nimport io.stigg.models.v1.customers.CustomerListPageAsync;\nimport io.stigg.models.v1.customers.CustomerListResponse;\nimport java.util.Optional;\nimport java.util.concurrent.CompletableFuture;\n\nCompletableFuture<CustomerListPageAsync> pageFuture = client.async().v1().customers().list();\n\npageFuture.thenRun(page -> page.autoPager().subscribe(customer -> {\n System.out.println(customer);\n}));\n\n// If you need to handle errors or completion of the stream\npageFuture.thenRun(page -> page.autoPager().subscribe(new AsyncStreamResponse.Handler<>() {\n @Override\n public void onNext(CustomerListResponse customer) {\n System.out.println(customer);\n }\n\n @Override\n public void onComplete(Optional<Throwable> error) {\n if (error.isPresent()) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error.get());\n } else {\n System.out.println("No more!");\n }\n }\n}));\n\n// Or use futures\npageFuture.thenRun(page -> page.autoPager()\n .subscribe(customer -> {\n System.out.println(customer);\n })\n .onCompleteFuture()\n .whenComplete((unused, error) -> {\n if (error != null) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error);\n } else {\n System.out.println("No more!");\n }\n }));\n```\n\n### Manual pagination\n\nTo access individual page items and manually request the next page, use the `items()`,\n`hasNextPage()`, and `nextPage()` methods:\n\n```java\nimport io.stigg.models.v1.customers.CustomerListPage;\nimport io.stigg.models.v1.customers.CustomerListResponse;\n\nCustomerListPage page = client.v1().customers().list();\nwhile (true) {\n for (CustomerListResponse customer : page.items()) {\n System.out.println(customer);\n }\n\n if (!page.hasNextPage()) {\n break;\n }\n\n page = page.nextPage();\n}\n```\n\n## Logging\n\nEnable logging by setting the `STIGG_LOG` environment variable to `info`:\n\n```sh\nexport STIGG_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport STIGG_LOG=debug\n```\n\nOr configure the client manually using the `logLevel` method:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport io.stigg.core.LogLevel;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n .logLevel(LogLevel.INFO)\n .build();\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `stigg-java-core` is published with a [configuration file](stigg-java-core/src/main/resources/META-INF/proguard/stigg-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`StiggOkHttpClient`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClient.kt) or [`StiggOkHttpClientAsync`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .build();\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```java\nimport io.stigg.models.v1.customers.CustomerResponse;\n\nCustomerResponse customerResponse = client.v1().customers().retrieve(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport java.time.Duration;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .build();\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport java.net.InetSocketAddress;\nimport java.net.Proxy;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n .proxy(new Proxy(\n Proxy.Type.HTTP, new InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .build();\n```\n\nIf the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport io.stigg.core.http.ProxyAuthenticator;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n .proxy(...)\n // Or a custom implementation of `ProxyAuthenticator`.\n .proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))\n .build();\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport java.time.Duration;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .build();\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .build();\n```\n\n\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `stigg-java-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`StiggClient`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClient.kt), [`StiggClientAsync`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientAsync.kt), [`StiggClientImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientImpl.kt), and [`StiggClientAsyncImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientAsyncImpl.kt), all of which can work with any HTTP client\n- `stigg-java-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`StiggOkHttpClient`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClient.kt) and [`StiggOkHttpClientAsync`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClientAsync.kt), which provide a way to construct [`StiggClientImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientImpl.kt) and [`StiggClientAsyncImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientAsyncImpl.kt), respectively, using OkHttp\n- `stigg-java`\n - Depends on and exposes the APIs of both `stigg-java-core` and `stigg-java-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`stigg-java` dependency](#installation) with `stigg-java-core`\n2. Copy `stigg-java-client-okhttp`\'s [`OkHttpClient`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`StiggClientImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientImpl.kt) or [`StiggClientAsyncImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientAsyncImpl.kt), similarly to [`StiggOkHttpClient`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClient.kt) or [`StiggOkHttpClientAsync`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`stigg-java` dependency](#installation) with `stigg-java-core`\n2. Write a class that implements the [`HttpClient`](stigg-java-core/src/main/kotlin/io/stigg/core/http/HttpClient.kt) interface\n3. Construct [`StiggClientImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientImpl.kt) or [`StiggClientAsyncImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientAsyncImpl.kt), similarly to [`StiggOkHttpClient`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClient.kt) or [`StiggOkHttpClientAsync`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```java\nimport io.stigg.core.JsonValue;\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\n\nCustomerRetrieveParams params = CustomerRetrieveParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build();\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:\n\n```java\nimport io.stigg.core.JsonValue;\nimport io.stigg.models.v1.customers.CustomerUpdateParams;\n\nCustomerUpdateParams params = CustomerUpdateParams.builder()\n .passthrough(CustomerUpdateParams.Passthrough.builder()\n .putAdditionalProperty("secretProperty", JsonValue.from("42"))\n .build())\n .build();\n```\n\nThese properties can be accessed on the nested built object later using the `_additionalProperties()` method.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](stigg-java-core/src/main/kotlin/io/stigg/core/Values.kt) object to its setter:\n\n```java\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\n\nCustomerRetrieveParams params = CustomerRetrieveParams.builder().build();\n```\n\nThe most straightforward way to create a [`JsonValue`](stigg-java-core/src/main/kotlin/io/stigg/core/Values.kt) is using its `from(...)` method:\n\n```java\nimport io.stigg.core.JsonValue;\nimport java.util.List;\nimport java.util.Map;\n\n// Create primitive JSON values\nJsonValue nullValue = JsonValue.from(null);\nJsonValue booleanValue = JsonValue.from(true);\nJsonValue numberValue = JsonValue.from(42);\nJsonValue stringValue = JsonValue.from("Hello World!");\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nJsonValue arrayValue = JsonValue.from(List.of(\n "Hello", "World"\n));\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nJsonValue objectValue = JsonValue.from(Map.of(\n "a", 1,\n "b", 2\n));\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nJsonValue complexValue = JsonValue.from(Map.of(\n "a", List.of(\n 1, 2\n ),\n "b", List.of(\n 3, 4\n )\n));\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](stigg-java-core/src/main/kotlin/io/stigg/core/Values.kt):\n\n```java\nimport io.stigg.core.JsonMissing;\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\n\nCustomerRetrieveParams params = CustomerRetrieveParams.builder()\n .id(JsonMissing.of())\n .build();\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```java\nimport io.stigg.core.JsonValue;\nimport java.util.Map;\n\nMap<String, JsonValue> additionalProperties = client.v1().customers().retrieve(params)._additionalProperties();\nJsonValue secretPropertyValue = additionalProperties.get("secretProperty");\n\nString result = secretPropertyValue.accept(new JsonValue.Visitor<>() {\n @Override\n public String visitNull() {\n return "It\'s null!";\n }\n\n @Override\n public String visitBoolean(boolean value) {\n return "It\'s a boolean!";\n }\n\n @Override\n public String visitNumber(Number value) {\n return "It\'s a number!";\n }\n\n // Other methods include `visitMissing`, `visitString`, `visitArray`, and `visitObject`\n // The default implementation of each unimplemented method delegates to `visitDefault`, which throws by default, but can also be overridden\n});\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```java\nimport io.stigg.core.JsonField;\nimport java.util.Optional;\n\nJsonField<Object> field = client.v1().customers().retrieve(params)._field();\n\nif (field.isMissing()) {\n // The property is absent from the JSON response\n} else if (field.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n Optional<String> jsonString = field.asString();\n\n // Try to deserialize into a custom type\n MyClass myObject = field.asUnknown().orElseThrow().convert(MyClass.class);\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`StiggInvalidDataException`](stigg-java-core/src/main/kotlin/io/stigg/errors/StiggInvalidDataException.kt) only if you directly access the property.\n\nValidating the response is _not_ forwards compatible with new types from the API for existing fields.\n\nIf you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```java\nimport io.stigg.models.v1.customers.CustomerResponse;\n\nCustomerResponse customerResponse = client.v1().customers().retrieve(params).validate();\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```java\nimport io.stigg.models.v1.customers.CustomerResponse;\n\nCustomerResponse customerResponse = client.v1().customers().retrieve(RequestOptions.builder().responseValidation(true).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .build();\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nJava `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField<T>` instead of just plain `T`?\n\nUsing `JsonField<T>` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/stiggio/stigg-java/issues) with questions, bugs, or suggestions.\n',
|
|
6854
|
+
'# Stigg Java API Library\n\n<!-- x-release-please-start-version -->\n[](https://central.sonatype.com/artifact/io.stigg/stigg-java/0.0.1)\n[](https://javadoc.io/doc/io.stigg/stigg-java/0.0.1)\n<!-- x-release-please-end -->\n\nThe Stigg Java SDK provides convenient access to the Stigg REST API from applications written in Java.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Stigg MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=%40stigg%2Ftypescript-mcp&config=eyJuYW1lIjoiQHN0aWdnL3R5cGVzY3JpcHQtbWNwIiwidHJhbnNwb3J0IjoiaHR0cCIsInVybCI6Imh0dHBzOi8vc3RpZ2ctbWNwLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IlgtQVBJLUtFWSI6Ik15IEFQSSBLZXkifX0)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40stigg%2Ftypescript-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fstigg-mcp.stlmcp.com%22%2C%22headers%22%3A%7B%22X-API-KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n<!-- x-release-please-start-version -->\n\nJavadocs are available on [javadoc.io](https://javadoc.io/doc/io.stigg/stigg-java/0.0.1).\n\n<!-- x-release-please-end -->\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n### Gradle\n\n~~~kotlin\nimplementation("io.stigg:stigg-java:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n<dependency>\n <groupId>io.stigg</groupId>\n <artifactId>stigg-java</artifactId>\n <version>0.0.1</version>\n</dependency>\n~~~\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport io.stigg.models.v1.customers.CustomerResponse;\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\n\n// Configures using the `stigg.apiKey` and `stigg.baseUrl` system properties\n// Or configures using the `STIGG_API_KEY` and `STIGG_BASE_URL` environment variables\nStiggClient client = StiggOkHttpClient.fromEnv();\n\nCustomerResponse customerResponse = client.v1().customers().retrieve("REPLACE_ME");\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\n\n// Configures using the `stigg.apiKey` and `stigg.baseUrl` system properties\n// Or configures using the `STIGG_API_KEY` and `STIGG_BASE_URL` environment variables\nStiggClient client = StiggOkHttpClient.fromEnv();\n```\n\nOr manually:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\n\nStiggClient client = StiggOkHttpClient.builder()\n .apiKey("My API Key")\n .build();\n```\n\nOr using a combination of the two approaches:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\n\nStiggClient client = StiggOkHttpClient.builder()\n // Configures using the `stigg.apiKey` and `stigg.baseUrl` system properties\n // Or configures using the `STIGG_API_KEY` and `STIGG_BASE_URL` environment variables\n .fromEnv()\n .apiKey("My API Key")\n .build();\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------- | --------------- | -------------------- | -------- | ------------------------ |\n| `apiKey` | `stigg.apiKey` | `STIGG_API_KEY` | true | - |\n| `baseUrl` | `stigg.baseUrl` | `STIGG_BASE_URL` | true | `"https://api.stigg.io"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```java\nimport io.stigg.client.StiggClient;\n\nStiggClient clientWithOptions = client.withOptions(optionsBuilder -> {\n optionsBuilder.baseUrl("https://example.com");\n optionsBuilder.maxRetries(42);\n});\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Stigg API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.\n\nFor example, `client.v1().customers().retrieve(...)` should be called with an instance of `CustomerRetrieveParams`, and it will return an instance of `CustomerResponse`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport io.stigg.models.v1.customers.CustomerResponse;\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `stigg.apiKey` and `stigg.baseUrl` system properties\n// Or configures using the `STIGG_API_KEY` and `STIGG_BASE_URL` environment variables\nStiggClient client = StiggOkHttpClient.fromEnv();\n\nCompletableFuture<CustomerResponse> customerResponse = client.async().v1().customers().retrieve("REPLACE_ME");\n```\n\nOr create an asynchronous client from the beginning:\n\n```java\nimport io.stigg.client.StiggClientAsync;\nimport io.stigg.client.okhttp.StiggOkHttpClientAsync;\nimport io.stigg.models.v1.customers.CustomerResponse;\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `stigg.apiKey` and `stigg.baseUrl` system properties\n// Or configures using the `STIGG_API_KEY` and `STIGG_BASE_URL` environment variables\nStiggClientAsync client = StiggOkHttpClientAsync.fromEnv();\n\nCompletableFuture<CustomerResponse> customerResponse = client.v1().customers().retrieve("REPLACE_ME");\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.\n\n\n\n\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Java classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```java\nimport io.stigg.core.http.Headers;\nimport io.stigg.core.http.HttpResponseFor;\nimport io.stigg.models.v1.customers.CustomerResponse;\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\n\nHttpResponseFor<CustomerResponse> customerResponse = client.v1().customers().withRawResponse().retrieve("REPLACE_ME");\n\nint statusCode = customerResponse.statusCode();\nHeaders headers = customerResponse.headers();\n```\n\nYou can still deserialize the response into an instance of a Java class if needed:\n\n```java\nimport io.stigg.models.v1.customers.CustomerResponse;\n\nCustomerResponse parsedCustomerResponse = customerResponse.parse();\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`StiggServiceException`](stigg-java-core/src/main/kotlin/io/stigg/errors/StiggServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](stigg-java-core/src/main/kotlin/io/stigg/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](stigg-java-core/src/main/kotlin/io/stigg/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](stigg-java-core/src/main/kotlin/io/stigg/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](stigg-java-core/src/main/kotlin/io/stigg/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](stigg-java-core/src/main/kotlin/io/stigg/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](stigg-java-core/src/main/kotlin/io/stigg/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](stigg-java-core/src/main/kotlin/io/stigg/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](stigg-java-core/src/main/kotlin/io/stigg/errors/UnexpectedStatusCodeException.kt) |\n\n- [`StiggIoException`](stigg-java-core/src/main/kotlin/io/stigg/errors/StiggIoException.kt): I/O networking errors.\n\n- [`StiggRetryableException`](stigg-java-core/src/main/kotlin/io/stigg/errors/StiggRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`StiggInvalidDataException`](stigg-java-core/src/main/kotlin/io/stigg/errors/StiggInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`StiggException`](stigg-java-core/src/main/kotlin/io/stigg/errors/StiggException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n## Pagination\n\nThe SDK defines methods that return a paginated lists of results. It provides convenient ways to access the results either one page at a time or item-by-item across all pages.\n\n### Auto-pagination\n\nTo iterate through all results across all pages, use the `autoPager()` method, which automatically fetches more pages as needed.\n\nWhen using the synchronous client, the method returns an [`Iterable`](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html)\n\n```java\nimport io.stigg.models.v1.customers.CustomerListPage;\nimport io.stigg.models.v1.customers.CustomerListResponse;\n\nCustomerListPage page = client.v1().customers().list();\n\n// Process as an Iterable\nfor (CustomerListResponse customer : page.autoPager()) {\n System.out.println(customer);\n}\n\n// Process as a Stream\npage.autoPager()\n .stream()\n .limit(50)\n .forEach(customer -> System.out.println(customer));\n```\n\nWhen using the asynchronous client, the method returns an [`AsyncStreamResponse`](stigg-java-core/src/main/kotlin/io/stigg/core/http/AsyncStreamResponse.kt):\n\n```java\nimport io.stigg.core.http.AsyncStreamResponse;\nimport io.stigg.models.v1.customers.CustomerListPageAsync;\nimport io.stigg.models.v1.customers.CustomerListResponse;\nimport java.util.Optional;\nimport java.util.concurrent.CompletableFuture;\n\nCompletableFuture<CustomerListPageAsync> pageFuture = client.async().v1().customers().list();\n\npageFuture.thenRun(page -> page.autoPager().subscribe(customer -> {\n System.out.println(customer);\n}));\n\n// If you need to handle errors or completion of the stream\npageFuture.thenRun(page -> page.autoPager().subscribe(new AsyncStreamResponse.Handler<>() {\n @Override\n public void onNext(CustomerListResponse customer) {\n System.out.println(customer);\n }\n\n @Override\n public void onComplete(Optional<Throwable> error) {\n if (error.isPresent()) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error.get());\n } else {\n System.out.println("No more!");\n }\n }\n}));\n\n// Or use futures\npageFuture.thenRun(page -> page.autoPager()\n .subscribe(customer -> {\n System.out.println(customer);\n })\n .onCompleteFuture()\n .whenComplete((unused, error) -> {\n if (error != null) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error);\n } else {\n System.out.println("No more!");\n }\n }));\n```\n\n### Manual pagination\n\nTo access individual page items and manually request the next page, use the `items()`,\n`hasNextPage()`, and `nextPage()` methods:\n\n```java\nimport io.stigg.models.v1.customers.CustomerListPage;\nimport io.stigg.models.v1.customers.CustomerListResponse;\n\nCustomerListPage page = client.v1().customers().list();\nwhile (true) {\n for (CustomerListResponse customer : page.items()) {\n System.out.println(customer);\n }\n\n if (!page.hasNextPage()) {\n break;\n }\n\n page = page.nextPage();\n}\n```\n\n## Logging\n\nEnable logging by setting the `STIGG_LOG` environment variable to `info`:\n\n```sh\nexport STIGG_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport STIGG_LOG=debug\n```\n\nOr configure the client manually using the `logLevel` method:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport io.stigg.core.LogLevel;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n .logLevel(LogLevel.INFO)\n .build();\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `stigg-java-core` is published with a [configuration file](stigg-java-core/src/main/resources/META-INF/proguard/stigg-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`StiggOkHttpClient`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClient.kt) or [`StiggOkHttpClientAsync`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .build();\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```java\nimport io.stigg.models.v1.customers.CustomerResponse;\n\nCustomerResponse customerResponse = client.v1().customers().retrieve(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport java.time.Duration;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .build();\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport java.net.InetSocketAddress;\nimport java.net.Proxy;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n .proxy(new Proxy(\n Proxy.Type.HTTP, new InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .build();\n```\n\nIf the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport io.stigg.core.http.ProxyAuthenticator;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n .proxy(...)\n // Or a custom implementation of `ProxyAuthenticator`.\n .proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))\n .build();\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport java.time.Duration;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .build();\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .build();\n```\n\n\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `stigg-java-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`StiggClient`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClient.kt), [`StiggClientAsync`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientAsync.kt), [`StiggClientImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientImpl.kt), and [`StiggClientAsyncImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientAsyncImpl.kt), all of which can work with any HTTP client\n- `stigg-java-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`StiggOkHttpClient`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClient.kt) and [`StiggOkHttpClientAsync`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClientAsync.kt), which provide a way to construct [`StiggClientImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientImpl.kt) and [`StiggClientAsyncImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientAsyncImpl.kt), respectively, using OkHttp\n- `stigg-java`\n - Depends on and exposes the APIs of both `stigg-java-core` and `stigg-java-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`stigg-java` dependency](#installation) with `stigg-java-core`\n2. Copy `stigg-java-client-okhttp`\'s [`OkHttpClient`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`StiggClientImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientImpl.kt) or [`StiggClientAsyncImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientAsyncImpl.kt), similarly to [`StiggOkHttpClient`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClient.kt) or [`StiggOkHttpClientAsync`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`stigg-java` dependency](#installation) with `stigg-java-core`\n2. Write a class that implements the [`HttpClient`](stigg-java-core/src/main/kotlin/io/stigg/core/http/HttpClient.kt) interface\n3. Construct [`StiggClientImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientImpl.kt) or [`StiggClientAsyncImpl`](stigg-java-core/src/main/kotlin/io/stigg/client/StiggClientAsyncImpl.kt), similarly to [`StiggOkHttpClient`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClient.kt) or [`StiggOkHttpClientAsync`](stigg-java-client-okhttp/src/main/kotlin/io/stigg/client/okhttp/StiggOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```java\nimport io.stigg.core.JsonValue;\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\n\nCustomerRetrieveParams params = CustomerRetrieveParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build();\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:\n\n```java\nimport io.stigg.core.JsonValue;\nimport io.stigg.models.v1.customers.CustomerUpdateParams;\n\nCustomerUpdateParams params = CustomerUpdateParams.builder()\n .passthrough(CustomerUpdateParams.Passthrough.builder()\n .putAdditionalProperty("secretProperty", JsonValue.from("42"))\n .build())\n .build();\n```\n\nThese properties can be accessed on the nested built object later using the `_additionalProperties()` method.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](stigg-java-core/src/main/kotlin/io/stigg/core/Values.kt) object to its setter:\n\n```java\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\n\nCustomerRetrieveParams params = CustomerRetrieveParams.builder().build();\n```\n\nThe most straightforward way to create a [`JsonValue`](stigg-java-core/src/main/kotlin/io/stigg/core/Values.kt) is using its `from(...)` method:\n\n```java\nimport io.stigg.core.JsonValue;\nimport java.util.List;\nimport java.util.Map;\n\n// Create primitive JSON values\nJsonValue nullValue = JsonValue.from(null);\nJsonValue booleanValue = JsonValue.from(true);\nJsonValue numberValue = JsonValue.from(42);\nJsonValue stringValue = JsonValue.from("Hello World!");\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nJsonValue arrayValue = JsonValue.from(List.of(\n "Hello", "World"\n));\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nJsonValue objectValue = JsonValue.from(Map.of(\n "a", 1,\n "b", 2\n));\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nJsonValue complexValue = JsonValue.from(Map.of(\n "a", List.of(\n 1, 2\n ),\n "b", List.of(\n 3, 4\n )\n));\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](stigg-java-core/src/main/kotlin/io/stigg/core/Values.kt):\n\n```java\nimport io.stigg.core.JsonMissing;\nimport io.stigg.models.v1.customers.CustomerRetrieveParams;\n\nCustomerRetrieveParams params = CustomerRetrieveParams.builder()\n .id(JsonMissing.of())\n .build();\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```java\nimport io.stigg.core.JsonValue;\nimport java.util.Map;\n\nMap<String, JsonValue> additionalProperties = client.v1().customers().retrieve(params)._additionalProperties();\nJsonValue secretPropertyValue = additionalProperties.get("secretProperty");\n\nString result = secretPropertyValue.accept(new JsonValue.Visitor<>() {\n @Override\n public String visitNull() {\n return "It\'s null!";\n }\n\n @Override\n public String visitBoolean(boolean value) {\n return "It\'s a boolean!";\n }\n\n @Override\n public String visitNumber(Number value) {\n return "It\'s a number!";\n }\n\n // Other methods include `visitMissing`, `visitString`, `visitArray`, and `visitObject`\n // The default implementation of each unimplemented method delegates to `visitDefault`, which throws by default, but can also be overridden\n});\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```java\nimport io.stigg.core.JsonField;\nimport java.util.Optional;\n\nJsonField<Object> field = client.v1().customers().retrieve(params)._field();\n\nif (field.isMissing()) {\n // The property is absent from the JSON response\n} else if (field.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n Optional<String> jsonString = field.asString();\n\n // Try to deserialize into a custom type\n MyClass myObject = field.asUnknown().orElseThrow().convert(MyClass.class);\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`StiggInvalidDataException`](stigg-java-core/src/main/kotlin/io/stigg/errors/StiggInvalidDataException.kt) only if you directly access the property.\n\nValidating the response is _not_ forwards compatible with new types from the API for existing fields.\n\nIf you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```java\nimport io.stigg.models.v1.customers.CustomerResponse;\n\nCustomerResponse customerResponse = client.v1().customers().retrieve(params).validate();\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```java\nimport io.stigg.models.v1.customers.CustomerResponse;\n\nCustomerResponse customerResponse = client.v1().customers().retrieve(RequestOptions.builder().responseValidation(true).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\n\nStiggClient client = StiggOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .build();\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nJava `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField<T>` instead of just plain `T`?\n\nUsing `JsonField<T>` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/stiggio/stigg-java/issues) with questions, bugs, or suggestions.\n',
|
|
6737
6855
|
},
|
|
6738
6856
|
{
|
|
6739
6857
|
language: 'python',
|