@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/local-docs-search.js
CHANGED
|
@@ -84,7 +84,7 @@ const EMBEDDED_METHODS = [
|
|
|
84
84
|
example: 'CustomerRetrieveParams parameters = new() { ID = "x" };\n\nvar customerResponse = await client.V1.Customers.Retrieve(parameters);\n\nConsole.WriteLine(customerResponse);',
|
|
85
85
|
},
|
|
86
86
|
http: {
|
|
87
|
-
example: 'curl https://
|
|
87
|
+
example: 'curl https://api.stigg.io/api/v1/customers/$ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
},
|
|
@@ -143,7 +143,7 @@ const EMBEDDED_METHODS = [
|
|
|
143
143
|
example: 'CustomerUpdateParams parameters = new() { ID = "x" };\n\nvar customerResponse = await client.V1.Customers.Update(parameters);\n\nConsole.WriteLine(customerResponse);',
|
|
144
144
|
},
|
|
145
145
|
http: {
|
|
146
|
-
example: "curl https://
|
|
146
|
+
example: "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 '{}'",
|
|
147
147
|
},
|
|
148
148
|
},
|
|
149
149
|
},
|
|
@@ -197,7 +197,7 @@ const EMBEDDED_METHODS = [
|
|
|
197
197
|
example: '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}',
|
|
198
198
|
},
|
|
199
199
|
http: {
|
|
200
|
-
example: 'curl https://
|
|
200
|
+
example: 'curl https://api.stigg.io/api/v1/customers \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
201
201
|
},
|
|
202
202
|
},
|
|
203
203
|
},
|
|
@@ -257,7 +257,7 @@ const EMBEDDED_METHODS = [
|
|
|
257
257
|
example: 'CustomerProvisionParams parameters = new() { ID = "id" };\n\nvar customerResponse = await client.V1.Customers.Provision(parameters);\n\nConsole.WriteLine(customerResponse);',
|
|
258
258
|
},
|
|
259
259
|
http: {
|
|
260
|
-
example: 'curl https://
|
|
260
|
+
example: '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 }\'',
|
|
261
261
|
},
|
|
262
262
|
},
|
|
263
263
|
},
|
|
@@ -302,7 +302,7 @@ const EMBEDDED_METHODS = [
|
|
|
302
302
|
example: 'CustomerArchiveParams parameters = new() { ID = "x" };\n\nvar customerResponse = await client.V1.Customers.Archive(parameters);\n\nConsole.WriteLine(customerResponse);',
|
|
303
303
|
},
|
|
304
304
|
http: {
|
|
305
|
-
example: 'curl https://
|
|
305
|
+
example: 'curl https://api.stigg.io/api/v1/customers/$ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
306
306
|
},
|
|
307
307
|
},
|
|
308
308
|
},
|
|
@@ -347,7 +347,7 @@ const EMBEDDED_METHODS = [
|
|
|
347
347
|
example: 'CustomerUnarchiveParams parameters = new() { ID = "x" };\n\nvar customerResponse = await client.V1.Customers.Unarchive(parameters);\n\nConsole.WriteLine(customerResponse);',
|
|
348
348
|
},
|
|
349
349
|
http: {
|
|
350
|
-
example: 'curl https://
|
|
350
|
+
example: 'curl https://api.stigg.io/api/v1/customers/$ID/unarchive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
351
351
|
},
|
|
352
352
|
},
|
|
353
353
|
},
|
|
@@ -397,7 +397,7 @@ const EMBEDDED_METHODS = [
|
|
|
397
397
|
example: 'CustomerImportParams parameters = new()\n{\n Customers =\n [\n new()\n {\n ID = "id",\n Email = "dev@stainless.com",\n Name = "name",\n BillingID = "billingId",\n Metadata = new Dictionary<string, string>() { { "foo", "string" } },\n PaymentMethodID = "paymentMethodId",\n SalesforceID = "salesforceId",\n UpdatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),\n },\n ],\n};\n\nvar response = await client.V1.Customers.Import(parameters);\n\nConsole.WriteLine(response);',
|
|
398
398
|
},
|
|
399
399
|
http: {
|
|
400
|
-
example: 'curl https://
|
|
400
|
+
example: '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 }\'',
|
|
401
401
|
},
|
|
402
402
|
},
|
|
403
403
|
},
|
|
@@ -449,7 +449,7 @@ const EMBEDDED_METHODS = [
|
|
|
449
449
|
example: 'CustomerListResourcesParams parameters = new() { ID = "x" };\n\nvar page = await client.V1.Customers.ListResources(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
450
450
|
},
|
|
451
451
|
http: {
|
|
452
|
-
example: 'curl https://
|
|
452
|
+
example: 'curl https://api.stigg.io/api/v1/customers/$ID/resources \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
453
453
|
},
|
|
454
454
|
},
|
|
455
455
|
},
|
|
@@ -494,7 +494,7 @@ const EMBEDDED_METHODS = [
|
|
|
494
494
|
example: 'CustomerRetrieveEntitlementsParams parameters = new() { ID = "x" };\n\nvar response = await client.V1.Customers.RetrieveEntitlements(parameters);\n\nConsole.WriteLine(response);',
|
|
495
495
|
},
|
|
496
496
|
http: {
|
|
497
|
-
example: 'curl https://
|
|
497
|
+
example: 'curl https://api.stigg.io/api/v1/customers/$ID/entitlements \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
498
498
|
},
|
|
499
499
|
},
|
|
500
500
|
},
|
|
@@ -548,7 +548,7 @@ const EMBEDDED_METHODS = [
|
|
|
548
548
|
example: 'CustomerCheckEntitlementParams parameters = new() { ID = "x" };\n\nvar response = await client.V1.Customers.CheckEntitlement(parameters);\n\nConsole.WriteLine(response);',
|
|
549
549
|
},
|
|
550
550
|
http: {
|
|
551
|
-
example: 'curl https://
|
|
551
|
+
example: 'curl https://api.stigg.io/api/v1/customers/$ID/entitlements/check \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
552
552
|
},
|
|
553
553
|
},
|
|
554
554
|
},
|
|
@@ -601,7 +601,7 @@ const EMBEDDED_METHODS = [
|
|
|
601
601
|
example: 'PaymentMethodAttachParams parameters = new()\n{\n ID = "x",\n IntegrationID = "integrationId",\n PaymentMethodID = "paymentMethodId",\n VendorIdentifier = VendorIdentifier.Auth0,\n};\n\nvar customerResponse = await client.V1.Customers.PaymentMethod.Attach(parameters);\n\nConsole.WriteLine(customerResponse);',
|
|
602
602
|
},
|
|
603
603
|
http: {
|
|
604
|
-
example: 'curl https://
|
|
604
|
+
example: '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 }\'',
|
|
605
605
|
},
|
|
606
606
|
},
|
|
607
607
|
},
|
|
@@ -646,7 +646,7 @@ const EMBEDDED_METHODS = [
|
|
|
646
646
|
example: 'PaymentMethodDetachParams parameters = new() { ID = "x" };\n\nvar customerResponse = await client.V1.Customers.PaymentMethod.Detach(parameters);\n\nConsole.WriteLine(customerResponse);',
|
|
647
647
|
},
|
|
648
648
|
http: {
|
|
649
|
-
example: 'curl https://
|
|
649
|
+
example: 'curl https://api.stigg.io/api/v1/customers/$ID/payment-method \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
650
650
|
},
|
|
651
651
|
},
|
|
652
652
|
},
|
|
@@ -700,7 +700,7 @@ const EMBEDDED_METHODS = [
|
|
|
700
700
|
example: 'PromotionalEntitlementListParams parameters = new() { ID = "x" };\n\nvar page = await client.V1.Customers.PromotionalEntitlements.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
701
701
|
},
|
|
702
702
|
http: {
|
|
703
|
-
example: 'curl https://
|
|
703
|
+
example: 'curl https://api.stigg.io/api/v1/customers/$ID/promotional-entitlements \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
704
704
|
},
|
|
705
705
|
},
|
|
706
706
|
},
|
|
@@ -750,7 +750,7 @@ const EMBEDDED_METHODS = [
|
|
|
750
750
|
example: 'PromotionalEntitlementCreateParams parameters = new()\n{\n ID = "x",\n PromotionalEntitlements =\n [\n new()\n {\n CustomEndDate = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),\n EnumValues =\n [\n "string"\n ],\n FeatureID = "featureId",\n HasSoftLimit = true,\n HasUnlimitedUsage = true,\n IsVisible = true,\n MonthlyResetPeriodConfiguration = new(\n AccordingTo.SubscriptionStart\n ),\n Period = Period.1Week,\n ResetPeriod = ResetPeriod.Year,\n UsageLimit = -9007199254740991,\n WeeklyResetPeriodConfiguration = new(AccordingTo.SubscriptionStart),\n YearlyResetPeriodConfiguration = new(AccordingTo.SubscriptionStart),\n },\n ],\n};\n\nvar promotionalEntitlement = await client.V1.Customers.PromotionalEntitlements.Create(parameters);\n\nConsole.WriteLine(promotionalEntitlement);',
|
|
751
751
|
},
|
|
752
752
|
http: {
|
|
753
|
-
example: 'curl https://
|
|
753
|
+
example: '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 }\'',
|
|
754
754
|
},
|
|
755
755
|
},
|
|
756
756
|
},
|
|
@@ -795,7 +795,7 @@ const EMBEDDED_METHODS = [
|
|
|
795
795
|
example: 'PromotionalEntitlementRevokeParams parameters = new()\n{\n ID = "id",\n FeatureID = "featureId",\n};\n\nvar response = await client.V1.Customers.PromotionalEntitlements.Revoke(parameters);\n\nConsole.WriteLine(response);',
|
|
796
796
|
},
|
|
797
797
|
http: {
|
|
798
|
-
example: 'curl https://
|
|
798
|
+
example: 'curl https://api.stigg.io/api/v1/customers/$ID/promotional-entitlements/$FEATURE_ID \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
799
799
|
},
|
|
800
800
|
},
|
|
801
801
|
},
|
|
@@ -848,7 +848,7 @@ const EMBEDDED_METHODS = [
|
|
|
848
848
|
example: 'IntegrationListParams parameters = new() { ID = "x" };\n\nvar page = await client.V1.Customers.Integrations.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
849
849
|
},
|
|
850
850
|
http: {
|
|
851
|
-
example: 'curl https://
|
|
851
|
+
example: 'curl https://api.stigg.io/api/v1/customers/$ID/integrations \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
852
852
|
},
|
|
853
853
|
},
|
|
854
854
|
},
|
|
@@ -900,7 +900,7 @@ const EMBEDDED_METHODS = [
|
|
|
900
900
|
example: 'IntegrationLinkParams parameters = new()\n{\n ID = "x",\n ID = "id",\n SyncedEntityID = "syncedEntityId",\n VendorIdentifier = VendorIdentifier.Auth0,\n};\n\nvar customerIntegrationResponse = await client.V1.Customers.Integrations.Link(parameters);\n\nConsole.WriteLine(customerIntegrationResponse);',
|
|
901
901
|
},
|
|
902
902
|
http: {
|
|
903
|
-
example: 'curl https://
|
|
903
|
+
example: '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 }\'',
|
|
904
904
|
},
|
|
905
905
|
},
|
|
906
906
|
},
|
|
@@ -945,7 +945,7 @@ const EMBEDDED_METHODS = [
|
|
|
945
945
|
example: 'IntegrationRetrieveParams parameters = new()\n{\n ID = "id",\n IntegrationID = "integrationId",\n};\n\nvar customerIntegrationResponse = await client.V1.Customers.Integrations.Retrieve(parameters);\n\nConsole.WriteLine(customerIntegrationResponse);',
|
|
946
946
|
},
|
|
947
947
|
http: {
|
|
948
|
-
example: 'curl https://
|
|
948
|
+
example: 'curl https://api.stigg.io/api/v1/customers/$ID/integrations/$INTEGRATION_ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
949
949
|
},
|
|
950
950
|
},
|
|
951
951
|
},
|
|
@@ -996,7 +996,7 @@ const EMBEDDED_METHODS = [
|
|
|
996
996
|
example: 'IntegrationUpdateParams parameters = new()\n{\n ID = "id",\n IntegrationID = "integrationId",\n SyncedEntityID = "syncedEntityId",\n};\n\nvar customerIntegrationResponse = await client.V1.Customers.Integrations.Update(parameters);\n\nConsole.WriteLine(customerIntegrationResponse);',
|
|
997
997
|
},
|
|
998
998
|
http: {
|
|
999
|
-
example: 'curl https://
|
|
999
|
+
example: '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 }\'',
|
|
1000
1000
|
},
|
|
1001
1001
|
},
|
|
1002
1002
|
},
|
|
@@ -1041,7 +1041,7 @@ const EMBEDDED_METHODS = [
|
|
|
1041
1041
|
example: 'IntegrationUnlinkParams parameters = new()\n{\n ID = "id",\n IntegrationID = "integrationId",\n};\n\nvar customerIntegrationResponse = await client.V1.Customers.Integrations.Unlink(parameters);\n\nConsole.WriteLine(customerIntegrationResponse);',
|
|
1042
1042
|
},
|
|
1043
1043
|
http: {
|
|
1044
|
-
example: 'curl https://
|
|
1044
|
+
example: 'curl https://api.stigg.io/api/v1/customers/$ID/integrations/$INTEGRATION_ID \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1045
1045
|
},
|
|
1046
1046
|
},
|
|
1047
1047
|
},
|
|
@@ -1086,7 +1086,7 @@ const EMBEDDED_METHODS = [
|
|
|
1086
1086
|
example: 'SubscriptionRetrieveParams parameters = new() { ID = "x" };\n\nvar subscription = await client.V1.Subscriptions.Retrieve(parameters);\n\nConsole.WriteLine(subscription);',
|
|
1087
1087
|
},
|
|
1088
1088
|
http: {
|
|
1089
|
-
example: 'curl https://
|
|
1089
|
+
example: 'curl https://api.stigg.io/api/v1/subscriptions/$ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1090
1090
|
},
|
|
1091
1091
|
},
|
|
1092
1092
|
},
|
|
@@ -1143,7 +1143,7 @@ const EMBEDDED_METHODS = [
|
|
|
1143
1143
|
example: '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}',
|
|
1144
1144
|
},
|
|
1145
1145
|
http: {
|
|
1146
|
-
example: 'curl https://
|
|
1146
|
+
example: 'curl https://api.stigg.io/api/v1/subscriptions \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1147
1147
|
},
|
|
1148
1148
|
},
|
|
1149
1149
|
},
|
|
@@ -1218,7 +1218,7 @@ const EMBEDDED_METHODS = [
|
|
|
1218
1218
|
example: 'SubscriptionProvisionParams parameters = new()\n{\n CustomerID = "customerId",\n PlanID = "planId",\n};\n\nvar response = await client.V1.Subscriptions.Provision(parameters);\n\nConsole.WriteLine(response);',
|
|
1219
1219
|
},
|
|
1220
1220
|
http: {
|
|
1221
|
-
example: 'curl https://
|
|
1221
|
+
example: '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 }\'',
|
|
1222
1222
|
},
|
|
1223
1223
|
},
|
|
1224
1224
|
},
|
|
@@ -1268,7 +1268,7 @@ const EMBEDDED_METHODS = [
|
|
|
1268
1268
|
example: 'SubscriptionTransferParams parameters = new()\n{\n ID = "x",\n DestinationResourceID = "destinationResourceId",\n};\n\nvar subscription = await client.V1.Subscriptions.Transfer(parameters);\n\nConsole.WriteLine(subscription);',
|
|
1269
1269
|
},
|
|
1270
1270
|
http: {
|
|
1271
|
-
example: 'curl https://
|
|
1271
|
+
example: '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 }\'',
|
|
1272
1272
|
},
|
|
1273
1273
|
},
|
|
1274
1274
|
},
|
|
@@ -1318,7 +1318,7 @@ const EMBEDDED_METHODS = [
|
|
|
1318
1318
|
example: 'SubscriptionMigrateParams parameters = new() { ID = "x" };\n\nvar subscription = await client.V1.Subscriptions.Migrate(parameters);\n\nConsole.WriteLine(subscription);',
|
|
1319
1319
|
},
|
|
1320
1320
|
http: {
|
|
1321
|
-
example: "curl https://
|
|
1321
|
+
example: "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 '{}'",
|
|
1322
1322
|
},
|
|
1323
1323
|
},
|
|
1324
1324
|
},
|
|
@@ -1368,7 +1368,7 @@ const EMBEDDED_METHODS = [
|
|
|
1368
1368
|
example: 'SubscriptionDelegateParams parameters = new()\n{\n ID = "x",\n TargetCustomerID = "targetCustomerId",\n};\n\nvar subscription = await client.V1.Subscriptions.Delegate(parameters);\n\nConsole.WriteLine(subscription);',
|
|
1369
1369
|
},
|
|
1370
1370
|
http: {
|
|
1371
|
-
example: 'curl https://
|
|
1371
|
+
example: '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 }\'',
|
|
1372
1372
|
},
|
|
1373
1373
|
},
|
|
1374
1374
|
},
|
|
@@ -1432,7 +1432,7 @@ const EMBEDDED_METHODS = [
|
|
|
1432
1432
|
example: 'SubscriptionPreviewParams parameters = new()\n{\n CustomerID = "customerId",\n PlanID = "planId",\n};\n\nvar response = await client.V1.Subscriptions.Preview(parameters);\n\nConsole.WriteLine(response);',
|
|
1433
1433
|
},
|
|
1434
1434
|
http: {
|
|
1435
|
-
example: 'curl https://
|
|
1435
|
+
example: '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 }\'',
|
|
1436
1436
|
},
|
|
1437
1437
|
},
|
|
1438
1438
|
},
|
|
@@ -1498,7 +1498,7 @@ const EMBEDDED_METHODS = [
|
|
|
1498
1498
|
example: 'SubscriptionUpdateParams parameters = new() { ID = "x" };\n\nvar subscription = await client.V1.Subscriptions.Update(parameters);\n\nConsole.WriteLine(subscription);',
|
|
1499
1499
|
},
|
|
1500
1500
|
http: {
|
|
1501
|
-
example: "curl https://
|
|
1501
|
+
example: "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 '{}'",
|
|
1502
1502
|
},
|
|
1503
1503
|
},
|
|
1504
1504
|
},
|
|
@@ -1548,7 +1548,7 @@ const EMBEDDED_METHODS = [
|
|
|
1548
1548
|
example: 'SubscriptionImportParams parameters = new()\n{\n Subscriptions =\n [\n new()\n {\n ID = "id",\n CustomerID = "customerId",\n PlanID = "planId",\n Addons =\n [\n new()\n {\n ID = "id",\n Quantity = 0,\n },\n ],\n BillingID = "billingId",\n BillingPeriod = BillingPeriod.Monthly,\n Charges =\n [\n new()\n {\n ID = "id",\n Quantity = 0,\n Type = Type.Feature,\n },\n ],\n EndDate = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),\n Metadata = new Dictionary<string, string>() { { "foo", "string" } },\n ResourceID = "resourceId",\n StartDate = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),\n },\n ],\n};\n\nvar response = await client.V1.Subscriptions.Import(parameters);\n\nConsole.WriteLine(response);',
|
|
1549
1549
|
},
|
|
1550
1550
|
http: {
|
|
1551
|
-
example: 'curl https://
|
|
1551
|
+
example: '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 }\'',
|
|
1552
1552
|
},
|
|
1553
1553
|
},
|
|
1554
1554
|
},
|
|
@@ -1601,7 +1601,7 @@ const EMBEDDED_METHODS = [
|
|
|
1601
1601
|
example: 'SubscriptionCancelParams parameters = new() { ID = "x" };\n\nvar subscription = await client.V1.Subscriptions.Cancel(parameters);\n\nConsole.WriteLine(subscription);',
|
|
1602
1602
|
},
|
|
1603
1603
|
http: {
|
|
1604
|
-
example: "curl https://
|
|
1604
|
+
example: "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 '{}'",
|
|
1605
1605
|
},
|
|
1606
1606
|
},
|
|
1607
1607
|
},
|
|
@@ -1646,7 +1646,7 @@ const EMBEDDED_METHODS = [
|
|
|
1646
1646
|
example: 'FutureUpdateCancelPendingPaymentParams parameters = new() { ID = "x" };\n\nvar cancelSubscription = await client.V1.Subscriptions.FutureUpdate.CancelPendingPayment(parameters);\n\nConsole.WriteLine(cancelSubscription);',
|
|
1647
1647
|
},
|
|
1648
1648
|
http: {
|
|
1649
|
-
example: 'curl https://
|
|
1649
|
+
example: 'curl https://api.stigg.io/api/v1/subscriptions/$ID/future-update/pending-payment \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1650
1650
|
},
|
|
1651
1651
|
},
|
|
1652
1652
|
},
|
|
@@ -1691,7 +1691,7 @@ const EMBEDDED_METHODS = [
|
|
|
1691
1691
|
example: 'FutureUpdateCancelScheduleParams parameters = new() { ID = "x" };\n\nvar cancelSubscription = await client.V1.Subscriptions.FutureUpdate.CancelSchedule(parameters);\n\nConsole.WriteLine(cancelSubscription);',
|
|
1692
1692
|
},
|
|
1693
1693
|
http: {
|
|
1694
|
-
example: 'curl https://
|
|
1694
|
+
example: 'curl https://api.stigg.io/api/v1/subscriptions/$ID/future-update/schedule \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1695
1695
|
},
|
|
1696
1696
|
},
|
|
1697
1697
|
},
|
|
@@ -1736,7 +1736,7 @@ const EMBEDDED_METHODS = [
|
|
|
1736
1736
|
example: 'UsageChargeUsageParams parameters = new() { ID = "x" };\n\nvar response = await client.V1.Subscriptions.Usage.ChargeUsage(parameters);\n\nConsole.WriteLine(response);',
|
|
1737
1737
|
},
|
|
1738
1738
|
http: {
|
|
1739
|
-
example: "curl https://
|
|
1739
|
+
example: "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 '{}'",
|
|
1740
1740
|
},
|
|
1741
1741
|
},
|
|
1742
1742
|
},
|
|
@@ -1781,7 +1781,7 @@ const EMBEDDED_METHODS = [
|
|
|
1781
1781
|
example: 'UsageSyncParams parameters = new() { ID = "x" };\n\nvar response = await client.V1.Subscriptions.Usage.Sync(parameters);\n\nConsole.WriteLine(response);',
|
|
1782
1782
|
},
|
|
1783
1783
|
http: {
|
|
1784
|
-
example: 'curl https://
|
|
1784
|
+
example: 'curl https://api.stigg.io/api/v1/subscriptions/$ID/usage/sync \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1785
1785
|
},
|
|
1786
1786
|
},
|
|
1787
1787
|
},
|
|
@@ -1826,7 +1826,7 @@ const EMBEDDED_METHODS = [
|
|
|
1826
1826
|
example: 'InvoiceMarkAsPaidParams parameters = new() { ID = "x" };\n\nvar response = await client.V1.Subscriptions.Invoice.MarkAsPaid(parameters);\n\nConsole.WriteLine(response);',
|
|
1827
1827
|
},
|
|
1828
1828
|
http: {
|
|
1829
|
-
example: 'curl https://
|
|
1829
|
+
example: 'curl https://api.stigg.io/api/v1/subscriptions/$ID/invoice/paid \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1830
1830
|
},
|
|
1831
1831
|
},
|
|
1832
1832
|
},
|
|
@@ -1881,7 +1881,7 @@ const EMBEDDED_METHODS = [
|
|
|
1881
1881
|
example: 'CouponCreateParams parameters = new()\n{\n ID = "id",\n AmountsOff =\n [\n new()\n {\n Amount = 0,\n Currency = Currency.Usd,\n },\n ],\n Description = "description",\n DurationInMonths = 1,\n Metadata = new Dictionary<string, string>() { { "foo", "string" } },\n Name = "name",\n PercentOff = 1,\n};\n\nvar coupon = await client.V1.Coupons.Create(parameters);\n\nConsole.WriteLine(coupon);',
|
|
1882
1882
|
},
|
|
1883
1883
|
http: {
|
|
1884
|
-
example: 'curl https://
|
|
1884
|
+
example: '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 }\'',
|
|
1885
1885
|
},
|
|
1886
1886
|
},
|
|
1887
1887
|
},
|
|
@@ -1936,7 +1936,7 @@ const EMBEDDED_METHODS = [
|
|
|
1936
1936
|
example: '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}',
|
|
1937
1937
|
},
|
|
1938
1938
|
http: {
|
|
1939
|
-
example: 'curl https://
|
|
1939
|
+
example: 'curl https://api.stigg.io/api/v1/coupons \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1940
1940
|
},
|
|
1941
1941
|
},
|
|
1942
1942
|
},
|
|
@@ -1981,7 +1981,7 @@ const EMBEDDED_METHODS = [
|
|
|
1981
1981
|
example: 'CouponRetrieveParams parameters = new() { ID = "x" };\n\nvar coupon = await client.V1.Coupons.Retrieve(parameters);\n\nConsole.WriteLine(coupon);',
|
|
1982
1982
|
},
|
|
1983
1983
|
http: {
|
|
1984
|
-
example: 'curl https://
|
|
1984
|
+
example: 'curl https://api.stigg.io/api/v1/coupons/$ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
1985
1985
|
},
|
|
1986
1986
|
},
|
|
1987
1987
|
},
|
|
@@ -2033,7 +2033,7 @@ const EMBEDDED_METHODS = [
|
|
|
2033
2033
|
example: 'CouponUpdateCouponParams parameters = new() { ID = "x" };\n\nvar coupon = await client.V1.Coupons.UpdateCoupon(parameters);\n\nConsole.WriteLine(coupon);',
|
|
2034
2034
|
},
|
|
2035
2035
|
http: {
|
|
2036
|
-
example: "curl https://
|
|
2036
|
+
example: "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 '{}'",
|
|
2037
2037
|
},
|
|
2038
2038
|
},
|
|
2039
2039
|
},
|
|
@@ -2078,7 +2078,7 @@ const EMBEDDED_METHODS = [
|
|
|
2078
2078
|
example: 'CouponArchiveCouponParams parameters = new() { ID = "x" };\n\nvar coupon = await client.V1.Coupons.ArchiveCoupon(parameters);\n\nConsole.WriteLine(coupon);',
|
|
2079
2079
|
},
|
|
2080
2080
|
http: {
|
|
2081
|
-
example: 'curl https://
|
|
2081
|
+
example: 'curl https://api.stigg.io/api/v1/coupons/$ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2082
2082
|
},
|
|
2083
2083
|
},
|
|
2084
2084
|
},
|
|
@@ -2127,7 +2127,7 @@ const EMBEDDED_METHODS = [
|
|
|
2127
2127
|
example: 'EventReportParams parameters = new()\n{\n Events =\n [\n new()\n {\n CustomerID = "customerId",\n EventName = "x",\n IdempotencyKey = "x",\n Dimensions = new Dictionary<string, Dimension>()\n {\n { "foo", "string" }\n },\n ResourceID = "resourceId",\n Timestamp = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),\n },\n ],\n};\n\nvar response = await client.V1.Events.Report(parameters);\n\nConsole.WriteLine(response);',
|
|
2128
2128
|
},
|
|
2129
2129
|
http: {
|
|
2130
|
-
example: 'curl https://
|
|
2130
|
+
example: '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 }\'',
|
|
2131
2131
|
},
|
|
2132
2132
|
},
|
|
2133
2133
|
},
|
|
@@ -2172,7 +2172,7 @@ const EMBEDDED_METHODS = [
|
|
|
2172
2172
|
example: 'DataExportTriggerSyncParams parameters = new();\n\nvar response = await client.V1.Events.DataExport.TriggerSync(parameters);\n\nConsole.WriteLine(response);',
|
|
2173
2173
|
},
|
|
2174
2174
|
http: {
|
|
2175
|
-
example: "curl https://
|
|
2175
|
+
example: "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 '{}'",
|
|
2176
2176
|
},
|
|
2177
2177
|
},
|
|
2178
2178
|
},
|
|
@@ -2223,7 +2223,7 @@ const EMBEDDED_METHODS = [
|
|
|
2223
2223
|
example: 'DataExportMintScopedTokenParams parameters = new() { ApplicationOrigin = "x" };\n\nvar response = await client.V1.Events.DataExport.MintScopedToken(parameters);\n\nConsole.WriteLine(response);',
|
|
2224
2224
|
},
|
|
2225
2225
|
http: {
|
|
2226
|
-
example: 'curl https://
|
|
2226
|
+
example: '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 }\'',
|
|
2227
2227
|
},
|
|
2228
2228
|
},
|
|
2229
2229
|
},
|
|
@@ -2268,7 +2268,7 @@ const EMBEDDED_METHODS = [
|
|
|
2268
2268
|
example: 'DataExportListModelsParams parameters = new();\n\nvar response = await client.V1.Events.DataExport.ListModels(parameters);\n\nConsole.WriteLine(response);',
|
|
2269
2269
|
},
|
|
2270
2270
|
http: {
|
|
2271
|
-
example: 'curl https://
|
|
2271
|
+
example: 'curl https://api.stigg.io/api/v1/data-export/models \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2272
2272
|
},
|
|
2273
2273
|
},
|
|
2274
2274
|
},
|
|
@@ -2319,7 +2319,7 @@ const EMBEDDED_METHODS = [
|
|
|
2319
2319
|
example: 'DestinationCreateParams parameters = new()\n{\n DestinationID = "x",\n DestinationType = "x",\n};\n\nvar destination = await client.V1.Events.DataExport.Destinations.Create(parameters);\n\nConsole.WriteLine(destination);',
|
|
2320
2320
|
},
|
|
2321
2321
|
http: {
|
|
2322
|
-
example: 'curl https://
|
|
2322
|
+
example: '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 }\'',
|
|
2323
2323
|
},
|
|
2324
2324
|
},
|
|
2325
2325
|
},
|
|
@@ -2364,7 +2364,7 @@ const EMBEDDED_METHODS = [
|
|
|
2364
2364
|
example: 'DestinationDeleteParams parameters = new() { DestinationID = "x" };\n\nvar destination = await client.V1.Events.DataExport.Destinations.Delete(parameters);\n\nConsole.WriteLine(destination);',
|
|
2365
2365
|
},
|
|
2366
2366
|
http: {
|
|
2367
|
-
example: 'curl https://
|
|
2367
|
+
example: 'curl https://api.stigg.io/api/v1/data-export/destinations/$DESTINATION_ID \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2368
2368
|
},
|
|
2369
2369
|
},
|
|
2370
2370
|
},
|
|
@@ -2415,7 +2415,7 @@ const EMBEDDED_METHODS = [
|
|
|
2415
2415
|
example: 'DestinationUpdateParams parameters = new()\n{\n DestinationID = "x",\n EnabledModels =\n [\n "x"\n ],\n IntegrationID = "x",\n};\n\nvar destination = await client.V1.Events.DataExport.Destinations.Update(parameters);\n\nConsole.WriteLine(destination);',
|
|
2416
2416
|
},
|
|
2417
2417
|
http: {
|
|
2418
|
-
example: 'curl https://
|
|
2418
|
+
example: '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 }\'',
|
|
2419
2419
|
},
|
|
2420
2420
|
},
|
|
2421
2421
|
},
|
|
@@ -2474,7 +2474,7 @@ const EMBEDDED_METHODS = [
|
|
|
2474
2474
|
example: 'CustomerRetrieveGovernanceParams parameters = new() { ID = "id" };\n\nvar response = await client.V1.Events.Beta.Customers.RetrieveGovernance(parameters);\n\nConsole.WriteLine(response);',
|
|
2475
2475
|
},
|
|
2476
2476
|
http: {
|
|
2477
|
-
example: 'curl https://
|
|
2477
|
+
example: 'curl https://api.stigg.io/api/v1-beta/customers/$ID/governance \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2478
2478
|
},
|
|
2479
2479
|
},
|
|
2480
2480
|
},
|
|
@@ -2532,7 +2532,7 @@ const EMBEDDED_METHODS = [
|
|
|
2532
2532
|
example: 'CreditGetUsageParams parameters = new() { CustomerID = "customerId" };\n\nvar response = await client.V1.Credits.GetUsage(parameters);\n\nConsole.WriteLine(response);',
|
|
2533
2533
|
},
|
|
2534
2534
|
http: {
|
|
2535
|
-
example: 'curl https://
|
|
2535
|
+
example: 'curl https://api.stigg.io/api/v1/credits/usage \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2536
2536
|
},
|
|
2537
2537
|
},
|
|
2538
2538
|
},
|
|
@@ -2582,7 +2582,7 @@ const EMBEDDED_METHODS = [
|
|
|
2582
2582
|
example: 'CreditGetAutoRechargeParams parameters = new()\n{\n CurrencyID = "currencyId",\n CustomerID = "customerId",\n};\n\nvar response = await client.V1.Credits.GetAutoRecharge(parameters);\n\nConsole.WriteLine(response);',
|
|
2583
2583
|
},
|
|
2584
2584
|
http: {
|
|
2585
|
-
example: 'curl https://
|
|
2585
|
+
example: 'curl https://api.stigg.io/api/v1/credits/auto-recharge \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2586
2586
|
},
|
|
2587
2587
|
},
|
|
2588
2588
|
},
|
|
@@ -2636,7 +2636,7 @@ const EMBEDDED_METHODS = [
|
|
|
2636
2636
|
example: '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}',
|
|
2637
2637
|
},
|
|
2638
2638
|
http: {
|
|
2639
|
-
example: 'curl https://
|
|
2639
|
+
example: 'curl https://api.stigg.io/api/v1/credits/ledger \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2640
2640
|
},
|
|
2641
2641
|
},
|
|
2642
2642
|
},
|
|
@@ -2691,7 +2691,7 @@ const EMBEDDED_METHODS = [
|
|
|
2691
2691
|
example: '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}',
|
|
2692
2692
|
},
|
|
2693
2693
|
http: {
|
|
2694
|
-
example: 'curl https://
|
|
2694
|
+
example: 'curl https://api.stigg.io/api/v1/credits/grants \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2695
2695
|
},
|
|
2696
2696
|
},
|
|
2697
2697
|
},
|
|
@@ -2754,7 +2754,7 @@ const EMBEDDED_METHODS = [
|
|
|
2754
2754
|
example: 'GrantCreateParams parameters = new()\n{\n Amount = 0,\n CurrencyID = "currencyId",\n CustomerID = "customerId",\n DisplayName = "displayName",\n GrantType = GrantType.Paid,\n};\n\nvar creditGrantResponse = await client.V1.Credits.Grants.Create(parameters);\n\nConsole.WriteLine(creditGrantResponse);',
|
|
2755
2755
|
},
|
|
2756
2756
|
http: {
|
|
2757
|
-
example: 'curl https://
|
|
2757
|
+
example: '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 }\'',
|
|
2758
2758
|
},
|
|
2759
2759
|
},
|
|
2760
2760
|
},
|
|
@@ -2799,7 +2799,7 @@ const EMBEDDED_METHODS = [
|
|
|
2799
2799
|
example: 'GrantVoidParams parameters = new() { ID = "x" };\n\nvar creditGrantResponse = await client.V1.Credits.Grants.Void(parameters);\n\nConsole.WriteLine(creditGrantResponse);',
|
|
2800
2800
|
},
|
|
2801
2801
|
http: {
|
|
2802
|
-
example: 'curl https://
|
|
2802
|
+
example: 'curl https://api.stigg.io/api/v1/credits/grants/$ID/void \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2803
2803
|
},
|
|
2804
2804
|
},
|
|
2805
2805
|
},
|
|
@@ -2851,7 +2851,7 @@ const EMBEDDED_METHODS = [
|
|
|
2851
2851
|
example: 'CustomCurrencyListParams parameters = new();\n\nvar page = await client.V1.Credits.CustomCurrencies.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
2852
2852
|
},
|
|
2853
2853
|
http: {
|
|
2854
|
-
example: 'curl https://
|
|
2854
|
+
example: 'curl https://api.stigg.io/api/v1/credits/custom-currencies \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
2855
2855
|
},
|
|
2856
2856
|
},
|
|
2857
2857
|
},
|
|
@@ -2905,7 +2905,7 @@ const EMBEDDED_METHODS = [
|
|
|
2905
2905
|
example: 'CustomCurrencyCreateParams parameters = new()\n{\n ID = "id",\n DisplayName = "displayName",\n};\n\nvar customCurrencyResponse = await client.V1.Credits.CustomCurrencies.Create(parameters);\n\nConsole.WriteLine(customCurrencyResponse);',
|
|
2906
2906
|
},
|
|
2907
2907
|
http: {
|
|
2908
|
-
example: 'curl https://
|
|
2908
|
+
example: '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 }\'',
|
|
2909
2909
|
},
|
|
2910
2910
|
},
|
|
2911
2911
|
},
|
|
@@ -2959,7 +2959,7 @@ const EMBEDDED_METHODS = [
|
|
|
2959
2959
|
example: 'CustomCurrencyUpdateParams parameters = new() { CurrencyID = "currencyId" };\n\nvar customCurrencyResponse = await client.V1.Credits.CustomCurrencies.Update(parameters);\n\nConsole.WriteLine(customCurrencyResponse);',
|
|
2960
2960
|
},
|
|
2961
2961
|
http: {
|
|
2962
|
-
example: "curl https://
|
|
2962
|
+
example: "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 '{}'",
|
|
2963
2963
|
},
|
|
2964
2964
|
},
|
|
2965
2965
|
},
|
|
@@ -3004,7 +3004,7 @@ const EMBEDDED_METHODS = [
|
|
|
3004
3004
|
example: 'CustomCurrencyArchiveParams parameters = new() { CurrencyID = "currencyId" };\n\nvar customCurrencyResponse = await client.V1.Credits.CustomCurrencies.Archive(parameters);\n\nConsole.WriteLine(customCurrencyResponse);',
|
|
3005
3005
|
},
|
|
3006
3006
|
http: {
|
|
3007
|
-
example: 'curl https://
|
|
3007
|
+
example: 'curl https://api.stigg.io/api/v1/credits/custom-currencies/$CURRENCY_ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3008
3008
|
},
|
|
3009
3009
|
},
|
|
3010
3010
|
},
|
|
@@ -3049,7 +3049,7 @@ const EMBEDDED_METHODS = [
|
|
|
3049
3049
|
example: 'CustomCurrencyUnarchiveParams parameters = new() { CurrencyID = "currencyId" };\n\nvar customCurrencyResponse = await client.V1.Credits.CustomCurrencies.Unarchive(parameters);\n\nConsole.WriteLine(customCurrencyResponse);',
|
|
3050
3050
|
},
|
|
3051
3051
|
http: {
|
|
3052
|
-
example: 'curl https://
|
|
3052
|
+
example: 'curl https://api.stigg.io/api/v1/credits/custom-currencies/$CURRENCY_ID/unarchive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3053
3053
|
},
|
|
3054
3054
|
},
|
|
3055
3055
|
},
|
|
@@ -3094,7 +3094,111 @@ const EMBEDDED_METHODS = [
|
|
|
3094
3094
|
example: 'CustomCurrencyListAssociatedEntitiesParams parameters = new()\n{\n CurrencyID = "currencyId"\n};\n\nvar response = await client.V1.Credits.CustomCurrencies.ListAssociatedEntities(parameters);\n\nConsole.WriteLine(response);',
|
|
3095
3095
|
},
|
|
3096
3096
|
http: {
|
|
3097
|
-
example: 'curl https://
|
|
3097
|
+
example: 'curl https://api.stigg.io/api/v1/credits/custom-currencies/$CURRENCY_ID/associated-entities \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3098
|
+
},
|
|
3099
|
+
},
|
|
3100
|
+
},
|
|
3101
|
+
{
|
|
3102
|
+
name: 'consume',
|
|
3103
|
+
endpoint: '/api/v1/credits/consumption',
|
|
3104
|
+
httpMethod: 'post',
|
|
3105
|
+
summary: 'Consume credits',
|
|
3106
|
+
description: 'Consumes a specified amount of credits directly from a customer wallet, with no feature mapping. Returns the optimistic balance.',
|
|
3107
|
+
stainlessPath: '(resource) v1.credits.consumption > (method) consume',
|
|
3108
|
+
qualified: 'client.v1.credits.consumption.consume',
|
|
3109
|
+
params: [
|
|
3110
|
+
'amount: number;',
|
|
3111
|
+
'currencyId: string;',
|
|
3112
|
+
'customerId: string;',
|
|
3113
|
+
'idempotencyKey: string;',
|
|
3114
|
+
'createdAt?: string;',
|
|
3115
|
+
'dimensions?: object;',
|
|
3116
|
+
'resourceId?: string;',
|
|
3117
|
+
'X-ACCOUNT-ID?: string;',
|
|
3118
|
+
'X-ENVIRONMENT-ID?: string;',
|
|
3119
|
+
],
|
|
3120
|
+
response: '{ data: { amount: number; currencyId: string; customerId: string; timestamp: string; credit?: { currencyId: string; currentUsage: number; timestamp: string; usageLimit: number; usagePeriodEnd?: string; }; resourceId?: string; }; }',
|
|
3121
|
+
markdown: "## 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```",
|
|
3122
|
+
perLanguage: {
|
|
3123
|
+
typescript: {
|
|
3124
|
+
method: 'client.v1.credits.consumption.consume',
|
|
3125
|
+
example: "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);",
|
|
3126
|
+
},
|
|
3127
|
+
python: {
|
|
3128
|
+
method: 'v1.credits.consumption.consume',
|
|
3129
|
+
example: '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)',
|
|
3130
|
+
},
|
|
3131
|
+
java: {
|
|
3132
|
+
method: 'v1().credits().consumption().consume',
|
|
3133
|
+
example: '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}',
|
|
3134
|
+
},
|
|
3135
|
+
go: {
|
|
3136
|
+
method: 'client.V1.Credits.Consumption.Consume',
|
|
3137
|
+
example: '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',
|
|
3138
|
+
},
|
|
3139
|
+
ruby: {
|
|
3140
|
+
method: 'v1.credits.consumption.consume',
|
|
3141
|
+
example: '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)',
|
|
3142
|
+
},
|
|
3143
|
+
cli: {
|
|
3144
|
+
method: 'consumption consume',
|
|
3145
|
+
example: "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",
|
|
3146
|
+
},
|
|
3147
|
+
csharp: {
|
|
3148
|
+
method: 'V1.Credits.Consumption.Consume',
|
|
3149
|
+
example: '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);',
|
|
3150
|
+
},
|
|
3151
|
+
http: {
|
|
3152
|
+
example: '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 }\'',
|
|
3153
|
+
},
|
|
3154
|
+
},
|
|
3155
|
+
},
|
|
3156
|
+
{
|
|
3157
|
+
name: 'consume_async',
|
|
3158
|
+
endpoint: '/api/v1/credits/consumption/async',
|
|
3159
|
+
httpMethod: 'post',
|
|
3160
|
+
summary: 'Consume credits asynchronously',
|
|
3161
|
+
description: 'Consumes credits directly from customer wallets asynchronously. Consumptions are reconciled asynchronously into the credit balances.',
|
|
3162
|
+
stainlessPath: '(resource) v1.credits.consumption > (method) consume_async',
|
|
3163
|
+
qualified: 'client.v1.credits.consumption.consumeAsync',
|
|
3164
|
+
params: [
|
|
3165
|
+
'consumptions: { amount: number; currencyId: string; customerId: string; idempotencyKey: string; createdAt?: string; dimensions?: object; resourceId?: string; }[];',
|
|
3166
|
+
'X-ACCOUNT-ID?: string;',
|
|
3167
|
+
'X-ENVIRONMENT-ID?: string;',
|
|
3168
|
+
],
|
|
3169
|
+
response: '{ data: object; }',
|
|
3170
|
+
markdown: "## 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```",
|
|
3171
|
+
perLanguage: {
|
|
3172
|
+
typescript: {
|
|
3173
|
+
method: 'client.v1.credits.consumption.consumeAsync',
|
|
3174
|
+
example: "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);",
|
|
3175
|
+
},
|
|
3176
|
+
python: {
|
|
3177
|
+
method: 'v1.credits.consumption.consume_async',
|
|
3178
|
+
example: '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)',
|
|
3179
|
+
},
|
|
3180
|
+
java: {
|
|
3181
|
+
method: 'v1().credits().consumption().consumeAsync',
|
|
3182
|
+
example: '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}',
|
|
3183
|
+
},
|
|
3184
|
+
go: {
|
|
3185
|
+
method: 'client.V1.Credits.Consumption.ConsumeAsync',
|
|
3186
|
+
example: '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',
|
|
3187
|
+
},
|
|
3188
|
+
ruby: {
|
|
3189
|
+
method: 'v1.credits.consumption.consume_async',
|
|
3190
|
+
example: '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)',
|
|
3191
|
+
},
|
|
3192
|
+
cli: {
|
|
3193
|
+
method: 'consumption consume_async',
|
|
3194
|
+
example: "stigg v1:credits:consumption consume-async \\\n --api-key 'My API Key' \\\n --consumption '{amount: 1, currencyId: currencyId, customerId: customerId, idempotencyKey: x}'",
|
|
3195
|
+
},
|
|
3196
|
+
csharp: {
|
|
3197
|
+
method: 'V1.Credits.Consumption.ConsumeAsync',
|
|
3198
|
+
example: '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);',
|
|
3199
|
+
},
|
|
3200
|
+
http: {
|
|
3201
|
+
example: '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 }\'',
|
|
3098
3202
|
},
|
|
3099
3203
|
},
|
|
3100
3204
|
},
|
|
@@ -3139,7 +3243,7 @@ const EMBEDDED_METHODS = [
|
|
|
3139
3243
|
example: 'FeatureRetrieveFeatureParams parameters = new() { ID = "x" };\n\nvar feature = await client.V1.Features.RetrieveFeature(parameters);\n\nConsole.WriteLine(feature);',
|
|
3140
3244
|
},
|
|
3141
3245
|
http: {
|
|
3142
|
-
example: 'curl https://
|
|
3246
|
+
example: 'curl https://api.stigg.io/api/v1/features/$ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3143
3247
|
},
|
|
3144
3248
|
},
|
|
3145
3249
|
},
|
|
@@ -3196,7 +3300,7 @@ const EMBEDDED_METHODS = [
|
|
|
3196
3300
|
example: 'FeatureUpdateFeatureParams parameters = new() { ID = "x" };\n\nvar feature = await client.V1.Features.UpdateFeature(parameters);\n\nConsole.WriteLine(feature);',
|
|
3197
3301
|
},
|
|
3198
3302
|
http: {
|
|
3199
|
-
example: "curl https://
|
|
3303
|
+
example: "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 '{}'",
|
|
3200
3304
|
},
|
|
3201
3305
|
},
|
|
3202
3306
|
},
|
|
@@ -3255,7 +3359,7 @@ const EMBEDDED_METHODS = [
|
|
|
3255
3359
|
example: 'FeatureCreateFeatureParams parameters = new()\n{\n ID = "id",\n DisplayName = "displayName",\n FeatureType = FeatureType.Boolean,\n};\n\nvar feature = await client.V1.Features.CreateFeature(parameters);\n\nConsole.WriteLine(feature);',
|
|
3256
3360
|
},
|
|
3257
3361
|
http: {
|
|
3258
|
-
example: 'curl https://
|
|
3362
|
+
example: '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 }\'',
|
|
3259
3363
|
},
|
|
3260
3364
|
},
|
|
3261
3365
|
},
|
|
@@ -3311,7 +3415,7 @@ const EMBEDDED_METHODS = [
|
|
|
3311
3415
|
example: '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}',
|
|
3312
3416
|
},
|
|
3313
3417
|
http: {
|
|
3314
|
-
example: 'curl https://
|
|
3418
|
+
example: 'curl https://api.stigg.io/api/v1/features \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3315
3419
|
},
|
|
3316
3420
|
},
|
|
3317
3421
|
},
|
|
@@ -3356,7 +3460,7 @@ const EMBEDDED_METHODS = [
|
|
|
3356
3460
|
example: 'FeatureArchiveFeatureParams parameters = new() { ID = "x" };\n\nvar feature = await client.V1.Features.ArchiveFeature(parameters);\n\nConsole.WriteLine(feature);',
|
|
3357
3461
|
},
|
|
3358
3462
|
http: {
|
|
3359
|
-
example: 'curl https://
|
|
3463
|
+
example: 'curl https://api.stigg.io/api/v1/features/$ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3360
3464
|
},
|
|
3361
3465
|
},
|
|
3362
3466
|
},
|
|
@@ -3401,7 +3505,7 @@ const EMBEDDED_METHODS = [
|
|
|
3401
3505
|
example: 'FeatureUnarchiveFeatureParams parameters = new() { ID = "x" };\n\nvar feature = await client.V1.Features.UnarchiveFeature(parameters);\n\nConsole.WriteLine(feature);',
|
|
3402
3506
|
},
|
|
3403
3507
|
http: {
|
|
3404
|
-
example: 'curl https://
|
|
3508
|
+
example: 'curl https://api.stigg.io/api/v1/features/$ID/unarchive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3405
3509
|
},
|
|
3406
3510
|
},
|
|
3407
3511
|
},
|
|
@@ -3455,7 +3559,7 @@ const EMBEDDED_METHODS = [
|
|
|
3455
3559
|
example: '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}',
|
|
3456
3560
|
},
|
|
3457
3561
|
http: {
|
|
3458
|
-
example: 'curl https://
|
|
3562
|
+
example: 'curl https://api.stigg.io/api/v1/addons \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3459
3563
|
},
|
|
3460
3564
|
},
|
|
3461
3565
|
},
|
|
@@ -3512,7 +3616,7 @@ const EMBEDDED_METHODS = [
|
|
|
3512
3616
|
example: 'AddonCreateParams parameters = new()\n{\n ID = "id",\n DisplayName = "displayName",\n ProductID = "productId",\n};\n\nvar addon = await client.V1.Addons.Create(parameters);\n\nConsole.WriteLine(addon);',
|
|
3513
3617
|
},
|
|
3514
3618
|
http: {
|
|
3515
|
-
example: 'curl https://
|
|
3619
|
+
example: '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 }\'',
|
|
3516
3620
|
},
|
|
3517
3621
|
},
|
|
3518
3622
|
},
|
|
@@ -3557,7 +3661,7 @@ const EMBEDDED_METHODS = [
|
|
|
3557
3661
|
example: 'AddonRetrieveParams parameters = new() { ID = "x" };\n\nvar addon = await client.V1.Addons.Retrieve(parameters);\n\nConsole.WriteLine(addon);',
|
|
3558
3662
|
},
|
|
3559
3663
|
http: {
|
|
3560
|
-
example: 'curl https://
|
|
3664
|
+
example: 'curl https://api.stigg.io/api/v1/addons/$ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3561
3665
|
},
|
|
3562
3666
|
},
|
|
3563
3667
|
},
|
|
@@ -3614,7 +3718,7 @@ const EMBEDDED_METHODS = [
|
|
|
3614
3718
|
example: 'AddonUpdateParams parameters = new() { ID = "x" };\n\nvar addon = await client.V1.Addons.Update(parameters);\n\nConsole.WriteLine(addon);',
|
|
3615
3719
|
},
|
|
3616
3720
|
http: {
|
|
3617
|
-
example: "curl https://
|
|
3721
|
+
example: "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 '{}'",
|
|
3618
3722
|
},
|
|
3619
3723
|
},
|
|
3620
3724
|
},
|
|
@@ -3659,7 +3763,7 @@ const EMBEDDED_METHODS = [
|
|
|
3659
3763
|
example: 'AddonArchiveParams parameters = new() { ID = "x" };\n\nvar addon = await client.V1.Addons.Archive(parameters);\n\nConsole.WriteLine(addon);',
|
|
3660
3764
|
},
|
|
3661
3765
|
http: {
|
|
3662
|
-
example: 'curl https://
|
|
3766
|
+
example: 'curl https://api.stigg.io/api/v1/addons/$ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3663
3767
|
},
|
|
3664
3768
|
},
|
|
3665
3769
|
},
|
|
@@ -3709,7 +3813,7 @@ const EMBEDDED_METHODS = [
|
|
|
3709
3813
|
example: 'AddonPublishParams parameters = new()\n{\n ID = "x",\n MigrationType = MigrationType.NewCustomers,\n};\n\nvar response = await client.V1.Addons.Publish(parameters);\n\nConsole.WriteLine(response);',
|
|
3710
3814
|
},
|
|
3711
3815
|
http: {
|
|
3712
|
-
example: 'curl https://
|
|
3816
|
+
example: '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 }\'',
|
|
3713
3817
|
},
|
|
3714
3818
|
},
|
|
3715
3819
|
},
|
|
@@ -3754,7 +3858,7 @@ const EMBEDDED_METHODS = [
|
|
|
3754
3858
|
example: 'AddonCreateDraftParams parameters = new() { ID = "x" };\n\nvar addon = await client.V1.Addons.CreateDraft(parameters);\n\nConsole.WriteLine(addon);',
|
|
3755
3859
|
},
|
|
3756
3860
|
http: {
|
|
3757
|
-
example: 'curl https://
|
|
3861
|
+
example: 'curl https://api.stigg.io/api/v1/addons/$ID/draft \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3758
3862
|
},
|
|
3759
3863
|
},
|
|
3760
3864
|
},
|
|
@@ -3799,7 +3903,7 @@ const EMBEDDED_METHODS = [
|
|
|
3799
3903
|
example: 'AddonRemoveDraftParams parameters = new() { ID = "x" };\n\nvar response = await client.V1.Addons.RemoveDraft(parameters);\n\nConsole.WriteLine(response);',
|
|
3800
3904
|
},
|
|
3801
3905
|
http: {
|
|
3802
|
-
example: 'curl https://
|
|
3906
|
+
example: 'curl https://api.stigg.io/api/v1/addons/$ID/draft \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3803
3907
|
},
|
|
3804
3908
|
},
|
|
3805
3909
|
},
|
|
@@ -3851,7 +3955,7 @@ const EMBEDDED_METHODS = [
|
|
|
3851
3955
|
example: '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}',
|
|
3852
3956
|
},
|
|
3853
3957
|
http: {
|
|
3854
|
-
example: 'curl https://
|
|
3958
|
+
example: 'curl https://api.stigg.io/api/v1/addons/$ID/charges \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3855
3959
|
},
|
|
3856
3960
|
},
|
|
3857
3961
|
},
|
|
@@ -3896,7 +4000,7 @@ const EMBEDDED_METHODS = [
|
|
|
3896
4000
|
example: 'EntitlementListParams parameters = new() { AddonID = "addonId" };\n\nvar entitlements = await client.V1.Addons.Entitlements.List(parameters);\n\nConsole.WriteLine(entitlements);',
|
|
3897
4001
|
},
|
|
3898
4002
|
http: {
|
|
3899
|
-
example: 'curl https://
|
|
4003
|
+
example: 'curl https://api.stigg.io/api/v1/addons/$ADDON_ID/entitlements \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
3900
4004
|
},
|
|
3901
4005
|
},
|
|
3902
4006
|
},
|
|
@@ -3946,7 +4050,7 @@ const EMBEDDED_METHODS = [
|
|
|
3946
4050
|
example: 'EntitlementCreateParams parameters = new()\n{\n AddonID = "addonId",\n Entitlements =\n [\n new Feature()\n {\n ID = "id",\n Behavior = Behavior.Increment,\n Description = "description",\n DisplayNameOverride = "displayNameOverride",\n EnumValues =\n [\n "string"\n ],\n HasSoftLimit = true,\n HasUnlimitedUsage = true,\n HiddenFromWidgets =\n [\n HiddenFromWidget.Paywall\n ],\n IsCustom = true,\n IsGranted = true,\n MonthlyResetPeriodConfiguration = new(\n AccordingTo.SubscriptionStart\n ),\n Order = 0,\n ResetPeriod = ResetPeriod.Year,\n UsageLimit = 0,\n WeeklyResetPeriodConfiguration = new(AccordingTo.SubscriptionStart),\n YearlyResetPeriodConfiguration = new(AccordingTo.SubscriptionStart),\n },\n ],\n};\n\nvar entitlement = await client.V1.Addons.Entitlements.Create(parameters);\n\nConsole.WriteLine(entitlement);',
|
|
3947
4051
|
},
|
|
3948
4052
|
http: {
|
|
3949
|
-
example: 'curl https://
|
|
4053
|
+
example: '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 }\'',
|
|
3950
4054
|
},
|
|
3951
4055
|
},
|
|
3952
4056
|
},
|
|
@@ -3996,7 +4100,7 @@ const EMBEDDED_METHODS = [
|
|
|
3996
4100
|
example: 'EntitlementUpdateParams parameters = new()\n{\n AddonID = "addonId",\n ID = "id",\n Body = new Feature()\n {\n Behavior = Behavior.Increment,\n Description = "description",\n DisplayNameOverride = "displayNameOverride",\n EnumValues =\n [\n "string"\n ],\n HasSoftLimit = true,\n HasUnlimitedUsage = true,\n HiddenFromWidgets =\n [\n HiddenFromWidget.Paywall\n ],\n IsCustom = true,\n IsGranted = true,\n MonthlyResetPeriodConfiguration = new(AccordingTo.SubscriptionStart),\n Order = 0,\n ResetPeriod = ResetPeriod.Year,\n UsageLimit = 0,\n WeeklyResetPeriodConfiguration = new(AccordingTo.SubscriptionStart),\n YearlyResetPeriodConfiguration = new(AccordingTo.SubscriptionStart),\n },\n};\n\nvar addonPackageEntitlement = await client.V1.Addons.Entitlements.Update(parameters);\n\nConsole.WriteLine(addonPackageEntitlement);',
|
|
3997
4101
|
},
|
|
3998
4102
|
http: {
|
|
3999
|
-
example: 'curl https://
|
|
4103
|
+
example: '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 }\'',
|
|
4000
4104
|
},
|
|
4001
4105
|
},
|
|
4002
4106
|
},
|
|
@@ -4041,7 +4145,7 @@ const EMBEDDED_METHODS = [
|
|
|
4041
4145
|
example: 'EntitlementDeleteParams parameters = new()\n{\n AddonID = "addonId",\n ID = "id",\n};\n\nvar addonPackageEntitlement = await client.V1.Addons.Entitlements.Delete(parameters);\n\nConsole.WriteLine(addonPackageEntitlement);',
|
|
4042
4146
|
},
|
|
4043
4147
|
http: {
|
|
4044
|
-
example: 'curl https://
|
|
4148
|
+
example: 'curl https://api.stigg.io/api/v1/addons/$ADDON_ID/entitlements/$ID \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4045
4149
|
},
|
|
4046
4150
|
},
|
|
4047
4151
|
},
|
|
@@ -4099,7 +4203,7 @@ const EMBEDDED_METHODS = [
|
|
|
4099
4203
|
example: 'PlanCreateParams parameters = new()\n{\n ID = "id",\n DisplayName = "displayName",\n ProductID = "productId",\n};\n\nvar plan = await client.V1.Plans.Create(parameters);\n\nConsole.WriteLine(plan);',
|
|
4100
4204
|
},
|
|
4101
4205
|
http: {
|
|
4102
|
-
example: 'curl https://
|
|
4206
|
+
example: '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 }\'',
|
|
4103
4207
|
},
|
|
4104
4208
|
},
|
|
4105
4209
|
},
|
|
@@ -4153,7 +4257,7 @@ const EMBEDDED_METHODS = [
|
|
|
4153
4257
|
example: '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}',
|
|
4154
4258
|
},
|
|
4155
4259
|
http: {
|
|
4156
|
-
example: 'curl https://
|
|
4260
|
+
example: 'curl https://api.stigg.io/api/v1/plans \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4157
4261
|
},
|
|
4158
4262
|
},
|
|
4159
4263
|
},
|
|
@@ -4198,7 +4302,7 @@ const EMBEDDED_METHODS = [
|
|
|
4198
4302
|
example: 'PlanRetrieveParams parameters = new() { ID = "x" };\n\nvar plan = await client.V1.Plans.Retrieve(parameters);\n\nConsole.WriteLine(plan);',
|
|
4199
4303
|
},
|
|
4200
4304
|
http: {
|
|
4201
|
-
example: 'curl https://
|
|
4305
|
+
example: 'curl https://api.stigg.io/api/v1/plans/$ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4202
4306
|
},
|
|
4203
4307
|
},
|
|
4204
4308
|
},
|
|
@@ -4255,7 +4359,7 @@ const EMBEDDED_METHODS = [
|
|
|
4255
4359
|
example: 'PlanUpdateParams parameters = new() { ID = "x" };\n\nvar plan = await client.V1.Plans.Update(parameters);\n\nConsole.WriteLine(plan);',
|
|
4256
4360
|
},
|
|
4257
4361
|
http: {
|
|
4258
|
-
example: "curl https://
|
|
4362
|
+
example: "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 '{}'",
|
|
4259
4363
|
},
|
|
4260
4364
|
},
|
|
4261
4365
|
},
|
|
@@ -4300,7 +4404,7 @@ const EMBEDDED_METHODS = [
|
|
|
4300
4404
|
example: 'PlanArchiveParams parameters = new() { ID = "x" };\n\nvar plan = await client.V1.Plans.Archive(parameters);\n\nConsole.WriteLine(plan);',
|
|
4301
4405
|
},
|
|
4302
4406
|
http: {
|
|
4303
|
-
example: 'curl https://
|
|
4407
|
+
example: 'curl https://api.stigg.io/api/v1/plans/$ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4304
4408
|
},
|
|
4305
4409
|
},
|
|
4306
4410
|
},
|
|
@@ -4350,7 +4454,7 @@ const EMBEDDED_METHODS = [
|
|
|
4350
4454
|
example: 'PlanPublishParams parameters = new()\n{\n ID = "x",\n MigrationType = MigrationType.NewCustomers,\n};\n\nvar response = await client.V1.Plans.Publish(parameters);\n\nConsole.WriteLine(response);',
|
|
4351
4455
|
},
|
|
4352
4456
|
http: {
|
|
4353
|
-
example: 'curl https://
|
|
4457
|
+
example: '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 }\'',
|
|
4354
4458
|
},
|
|
4355
4459
|
},
|
|
4356
4460
|
},
|
|
@@ -4395,7 +4499,7 @@ const EMBEDDED_METHODS = [
|
|
|
4395
4499
|
example: 'PlanCreateDraftParams parameters = new() { ID = "x" };\n\nvar plan = await client.V1.Plans.CreateDraft(parameters);\n\nConsole.WriteLine(plan);',
|
|
4396
4500
|
},
|
|
4397
4501
|
http: {
|
|
4398
|
-
example: 'curl https://
|
|
4502
|
+
example: 'curl https://api.stigg.io/api/v1/plans/$ID/draft \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4399
4503
|
},
|
|
4400
4504
|
},
|
|
4401
4505
|
},
|
|
@@ -4440,7 +4544,7 @@ const EMBEDDED_METHODS = [
|
|
|
4440
4544
|
example: 'PlanRemoveDraftParams parameters = new() { ID = "x" };\n\nvar response = await client.V1.Plans.RemoveDraft(parameters);\n\nConsole.WriteLine(response);',
|
|
4441
4545
|
},
|
|
4442
4546
|
http: {
|
|
4443
|
-
example: 'curl https://
|
|
4547
|
+
example: 'curl https://api.stigg.io/api/v1/plans/$ID/draft \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4444
4548
|
},
|
|
4445
4549
|
},
|
|
4446
4550
|
},
|
|
@@ -4492,7 +4596,7 @@ const EMBEDDED_METHODS = [
|
|
|
4492
4596
|
example: '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}',
|
|
4493
4597
|
},
|
|
4494
4598
|
http: {
|
|
4495
|
-
example: 'curl https://
|
|
4599
|
+
example: 'curl https://api.stigg.io/api/v1/plans/$ID/charges \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4496
4600
|
},
|
|
4497
4601
|
},
|
|
4498
4602
|
},
|
|
@@ -4544,7 +4648,7 @@ const EMBEDDED_METHODS = [
|
|
|
4544
4648
|
example: 'PlanListOverageChargesParams parameters = new() { ID = "x" };\n\nvar page = await client.V1.Plans.ListOverageCharges(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
4545
4649
|
},
|
|
4546
4650
|
http: {
|
|
4547
|
-
example: 'curl https://
|
|
4651
|
+
example: 'curl https://api.stigg.io/api/v1/plans/$ID/overage-charges \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4548
4652
|
},
|
|
4549
4653
|
},
|
|
4550
4654
|
},
|
|
@@ -4589,7 +4693,7 @@ const EMBEDDED_METHODS = [
|
|
|
4589
4693
|
example: 'EntitlementListParams parameters = new() { PlanID = "planId" };\n\nvar entitlements = await client.V1.Plans.Entitlements.List(parameters);\n\nConsole.WriteLine(entitlements);',
|
|
4590
4694
|
},
|
|
4591
4695
|
http: {
|
|
4592
|
-
example: 'curl https://
|
|
4696
|
+
example: 'curl https://api.stigg.io/api/v1/plans/$PLAN_ID/entitlements \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4593
4697
|
},
|
|
4594
4698
|
},
|
|
4595
4699
|
},
|
|
@@ -4639,7 +4743,7 @@ const EMBEDDED_METHODS = [
|
|
|
4639
4743
|
example: 'EntitlementCreateParams parameters = new()\n{\n PlanID = "planId",\n Entitlements =\n [\n new Feature()\n {\n ID = "id",\n Behavior = Behavior.Increment,\n Description = "description",\n DisplayNameOverride = "displayNameOverride",\n EnumValues =\n [\n "string"\n ],\n HasSoftLimit = true,\n HasUnlimitedUsage = true,\n HiddenFromWidgets =\n [\n HiddenFromWidget.Paywall\n ],\n IsCustom = true,\n IsGranted = true,\n MonthlyResetPeriodConfiguration = new(\n AccordingTo.SubscriptionStart\n ),\n Order = 0,\n ResetPeriod = ResetPeriod.Year,\n UsageLimit = 0,\n WeeklyResetPeriodConfiguration = new(AccordingTo.SubscriptionStart),\n YearlyResetPeriodConfiguration = new(AccordingTo.SubscriptionStart),\n },\n ],\n};\n\nvar entitlement = await client.V1.Plans.Entitlements.Create(parameters);\n\nConsole.WriteLine(entitlement);',
|
|
4640
4744
|
},
|
|
4641
4745
|
http: {
|
|
4642
|
-
example: 'curl https://
|
|
4746
|
+
example: '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 }\'',
|
|
4643
4747
|
},
|
|
4644
4748
|
},
|
|
4645
4749
|
},
|
|
@@ -4689,7 +4793,7 @@ const EMBEDDED_METHODS = [
|
|
|
4689
4793
|
example: 'EntitlementUpdateParams parameters = new()\n{\n PlanID = "planId",\n ID = "id",\n Body = new Feature()\n {\n Behavior = Behavior.Increment,\n Description = "description",\n DisplayNameOverride = "displayNameOverride",\n EnumValues =\n [\n "string"\n ],\n HasSoftLimit = true,\n HasUnlimitedUsage = true,\n HiddenFromWidgets =\n [\n HiddenFromWidget.Paywall\n ],\n IsCustom = true,\n IsGranted = true,\n MonthlyResetPeriodConfiguration = new(AccordingTo.SubscriptionStart),\n Order = 0,\n ResetPeriod = ResetPeriod.Year,\n UsageLimit = 0,\n WeeklyResetPeriodConfiguration = new(AccordingTo.SubscriptionStart),\n YearlyResetPeriodConfiguration = new(AccordingTo.SubscriptionStart),\n },\n};\n\nvar planEntitlement = await client.V1.Plans.Entitlements.Update(parameters);\n\nConsole.WriteLine(planEntitlement);',
|
|
4690
4794
|
},
|
|
4691
4795
|
http: {
|
|
4692
|
-
example: 'curl https://
|
|
4796
|
+
example: '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 }\'',
|
|
4693
4797
|
},
|
|
4694
4798
|
},
|
|
4695
4799
|
},
|
|
@@ -4734,7 +4838,7 @@ const EMBEDDED_METHODS = [
|
|
|
4734
4838
|
example: 'EntitlementDeleteParams parameters = new()\n{\n PlanID = "planId",\n ID = "id",\n};\n\nvar planEntitlement = await client.V1.Plans.Entitlements.Delete(parameters);\n\nConsole.WriteLine(planEntitlement);',
|
|
4735
4839
|
},
|
|
4736
4840
|
http: {
|
|
4737
|
-
example: 'curl https://
|
|
4841
|
+
example: 'curl https://api.stigg.io/api/v1/plans/$PLAN_ID/entitlements/$ID \\\n -X DELETE \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4738
4842
|
},
|
|
4739
4843
|
},
|
|
4740
4844
|
},
|
|
@@ -4783,7 +4887,7 @@ const EMBEDDED_METHODS = [
|
|
|
4783
4887
|
example: 'UsageReportParams parameters = new()\n{\n Usages =\n [\n new()\n {\n CustomerID = "customerId",\n FeatureID = "featureId",\n Value = -9007199254740991,\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 UpdateBehavior = UpdateBehavior.Delta,\n },\n ],\n};\n\nvar response = await client.V1.Usage.Report(parameters);\n\nConsole.WriteLine(response);',
|
|
4784
4888
|
},
|
|
4785
4889
|
http: {
|
|
4786
|
-
example: 'curl https://
|
|
4890
|
+
example: '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 }\'',
|
|
4787
4891
|
},
|
|
4788
4892
|
},
|
|
4789
4893
|
},
|
|
@@ -4837,7 +4941,7 @@ const EMBEDDED_METHODS = [
|
|
|
4837
4941
|
example: 'UsageHistoryParams parameters = new()\n{\n CustomerID = "customerId",\n FeatureID = "featureId",\n StartDate = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),\n};\n\nvar response = await client.V1.Usage.History(parameters);\n\nConsole.WriteLine(response);',
|
|
4838
4942
|
},
|
|
4839
4943
|
http: {
|
|
4840
|
-
example: 'curl https://
|
|
4944
|
+
example: 'curl https://api.stigg.io/api/v1/usage/$CUSTOMER_ID/history/$FEATURE_ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4841
4945
|
},
|
|
4842
4946
|
},
|
|
4843
4947
|
},
|
|
@@ -4891,7 +4995,7 @@ const EMBEDDED_METHODS = [
|
|
|
4891
4995
|
example: '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}',
|
|
4892
4996
|
},
|
|
4893
4997
|
http: {
|
|
4894
|
-
example: 'curl https://
|
|
4998
|
+
example: 'curl https://api.stigg.io/api/v1/products \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
4895
4999
|
},
|
|
4896
5000
|
},
|
|
4897
5001
|
},
|
|
@@ -4944,7 +5048,7 @@ const EMBEDDED_METHODS = [
|
|
|
4944
5048
|
example: 'ProductCreateProductParams parameters = new()\n{\n ID = "id",\n DisplayName = "displayName",\n};\n\nvar product = await client.V1.Products.CreateProduct(parameters);\n\nConsole.WriteLine(product);',
|
|
4945
5049
|
},
|
|
4946
5050
|
http: {
|
|
4947
|
-
example: 'curl https://
|
|
5051
|
+
example: '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 }\'',
|
|
4948
5052
|
},
|
|
4949
5053
|
},
|
|
4950
5054
|
},
|
|
@@ -4999,7 +5103,7 @@ const EMBEDDED_METHODS = [
|
|
|
4999
5103
|
example: 'ProductUpdateProductParams parameters = new() { ID = "x" };\n\nvar product = await client.V1.Products.UpdateProduct(parameters);\n\nConsole.WriteLine(product);',
|
|
5000
5104
|
},
|
|
5001
5105
|
http: {
|
|
5002
|
-
example: "curl https://
|
|
5106
|
+
example: "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 '{}'",
|
|
5003
5107
|
},
|
|
5004
5108
|
},
|
|
5005
5109
|
},
|
|
@@ -5044,7 +5148,7 @@ const EMBEDDED_METHODS = [
|
|
|
5044
5148
|
example: 'ProductArchiveProductParams parameters = new() { ID = "x" };\n\nvar product = await client.V1.Products.ArchiveProduct(parameters);\n\nConsole.WriteLine(product);',
|
|
5045
5149
|
},
|
|
5046
5150
|
http: {
|
|
5047
|
-
example: 'curl https://
|
|
5151
|
+
example: 'curl https://api.stigg.io/api/v1/products/$ID/archive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5048
5152
|
},
|
|
5049
5153
|
},
|
|
5050
5154
|
},
|
|
@@ -5089,7 +5193,7 @@ const EMBEDDED_METHODS = [
|
|
|
5089
5193
|
example: 'ProductUnarchiveProductParams parameters = new() { ID = "x" };\n\nvar product = await client.V1.Products.UnarchiveProduct(parameters);\n\nConsole.WriteLine(product);',
|
|
5090
5194
|
},
|
|
5091
5195
|
http: {
|
|
5092
|
-
example: 'curl https://
|
|
5196
|
+
example: 'curl https://api.stigg.io/api/v1/products/$ID/unarchive \\\n -X POST \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5093
5197
|
},
|
|
5094
5198
|
},
|
|
5095
5199
|
},
|
|
@@ -5141,7 +5245,7 @@ const EMBEDDED_METHODS = [
|
|
|
5141
5245
|
example: 'ProductDuplicateProductParams parameters = new()\n{\n ID = "x",\n TargetID = "targetId",\n};\n\nvar product = await client.V1.Products.DuplicateProduct(parameters);\n\nConsole.WriteLine(product);',
|
|
5142
5246
|
},
|
|
5143
5247
|
http: {
|
|
5144
|
-
example: 'curl https://
|
|
5248
|
+
example: '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 }\'',
|
|
5145
5249
|
},
|
|
5146
5250
|
},
|
|
5147
5251
|
},
|
|
@@ -5196,7 +5300,7 @@ const EMBEDDED_METHODS = [
|
|
|
5196
5300
|
example: 'EntitlementCheckParams parameters = new() { ID = "x" };\n\nvar response = await client.V1Beta.Customers.Entitlements.Check(parameters);\n\nConsole.WriteLine(response);',
|
|
5197
5301
|
},
|
|
5198
5302
|
http: {
|
|
5199
|
-
example: 'curl https://
|
|
5303
|
+
example: 'curl https://api.stigg.io/api/v1-beta/customers/$ID/entitlements/check \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5200
5304
|
},
|
|
5201
5305
|
},
|
|
5202
5306
|
},
|
|
@@ -5250,7 +5354,7 @@ const EMBEDDED_METHODS = [
|
|
|
5250
5354
|
example: 'EntityListParams parameters = new() { ID = "id" };\n\nvar page = await client.V1Beta.Customers.Entities.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
5251
5355
|
},
|
|
5252
5356
|
http: {
|
|
5253
|
-
example: 'curl https://
|
|
5357
|
+
example: 'curl https://api.stigg.io/api/v1-beta/customers/$ID/entities \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5254
5358
|
},
|
|
5255
5359
|
},
|
|
5256
5360
|
},
|
|
@@ -5300,7 +5404,7 @@ const EMBEDDED_METHODS = [
|
|
|
5300
5404
|
example: 'EntityUpsertParams parameters = new()\n{\n ID = "id",\n Entities =\n [\n new()\n {\n ID = "user-7f3a0c1d",\n Metadata = new Dictionary<string, string>()\n {\n { "email", "jane@acme.com" }, { "role", "admin" }\n },\n TypeRefID = "user",\n },\n new()\n {\n ID = "user-c4d1b2e9",\n Metadata = new Dictionary<string, string>()\n {\n { "email", "john@acme.com" }\n },\n TypeRefID = "user",\n },\n ],\n};\n\nvar response = await client.V1Beta.Customers.Entities.Upsert(parameters);\n\nConsole.WriteLine(response);',
|
|
5301
5405
|
},
|
|
5302
5406
|
http: {
|
|
5303
|
-
example: 'curl https://
|
|
5407
|
+
example: '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 }\'',
|
|
5304
5408
|
},
|
|
5305
5409
|
},
|
|
5306
5410
|
},
|
|
@@ -5345,7 +5449,7 @@ const EMBEDDED_METHODS = [
|
|
|
5345
5449
|
example: 'EntityRetrieveParams parameters = new()\n{\n ID = "id",\n EntityID = "x",\n};\n\nvar entity = await client.V1Beta.Customers.Entities.Retrieve(parameters);\n\nConsole.WriteLine(entity);',
|
|
5346
5450
|
},
|
|
5347
5451
|
http: {
|
|
5348
|
-
example: 'curl https://
|
|
5452
|
+
example: 'curl https://api.stigg.io/api/v1-beta/customers/$ID/entities/$ENTITY_ID \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5349
5453
|
},
|
|
5350
5454
|
},
|
|
5351
5455
|
},
|
|
@@ -5390,7 +5494,7 @@ const EMBEDDED_METHODS = [
|
|
|
5390
5494
|
example: 'EntityArchiveParams parameters = new()\n{\n ID = "id",\n Ids =\n [\n "user-7f3a0c1d", "user-c4d1b2e9"\n ],\n};\n\nvar response = await client.V1Beta.Customers.Entities.Archive(parameters);\n\nConsole.WriteLine(response);',
|
|
5391
5495
|
},
|
|
5392
5496
|
http: {
|
|
5393
|
-
example: 'curl https://
|
|
5497
|
+
example: '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 }\'',
|
|
5394
5498
|
},
|
|
5395
5499
|
},
|
|
5396
5500
|
},
|
|
@@ -5435,7 +5539,7 @@ const EMBEDDED_METHODS = [
|
|
|
5435
5539
|
example: 'EntityUnarchiveParams parameters = new()\n{\n ID = "id",\n Ids =\n [\n "user-7f3a0c1d", "user-c4d1b2e9"\n ],\n};\n\nvar response = await client.V1Beta.Customers.Entities.Unarchive(parameters);\n\nConsole.WriteLine(response);',
|
|
5436
5540
|
},
|
|
5437
5541
|
http: {
|
|
5438
|
-
example: 'curl https://
|
|
5542
|
+
example: '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 }\'',
|
|
5439
5543
|
},
|
|
5440
5544
|
},
|
|
5441
5545
|
},
|
|
@@ -5489,7 +5593,7 @@ const EMBEDDED_METHODS = [
|
|
|
5489
5593
|
example: 'AssignmentListParams parameters = new() { ID = "id" };\n\nvar page = await client.V1Beta.Customers.Assignments.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
|
|
5490
5594
|
},
|
|
5491
5595
|
http: {
|
|
5492
|
-
example: 'curl https://
|
|
5596
|
+
example: 'curl https://api.stigg.io/api/v1-beta/customers/$ID/assignments \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5493
5597
|
},
|
|
5494
5598
|
},
|
|
5495
5599
|
},
|
|
@@ -5539,7 +5643,7 @@ const EMBEDDED_METHODS = [
|
|
|
5539
5643
|
example: 'AssignmentUpsertParams parameters = new()\n{\n ID = "id",\n Assignments =\n [\n new()\n {\n EntityID = "workspace-001",\n Cadence = "P1M",\n CurrencyID = "currencyId",\n FeatureID = "compute-minutes",\n ParentID = "parentId",\n ScopeEntityIds =\n [\n "NxI"\n ],\n UsageLimit = 1000,\n },\n new()\n {\n EntityID = "workspace-002",\n Cadence = "P1M",\n CurrencyID = "cred-type-tokens",\n FeatureID = "featureId",\n ParentID = "workspace-001",\n ScopeEntityIds =\n [\n "user-1"\n ],\n UsageLimit = 2000,\n },\n ],\n};\n\nvar response = await client.V1Beta.Customers.Assignments.Upsert(parameters);\n\nConsole.WriteLine(response);',
|
|
5540
5644
|
},
|
|
5541
5645
|
http: {
|
|
5542
|
-
example: 'curl https://
|
|
5646
|
+
example: '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 }\'',
|
|
5543
5647
|
},
|
|
5544
5648
|
},
|
|
5545
5649
|
},
|
|
@@ -5590,7 +5694,7 @@ const EMBEDDED_METHODS = [
|
|
|
5590
5694
|
example: '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}',
|
|
5591
5695
|
},
|
|
5592
5696
|
http: {
|
|
5593
|
-
example: 'curl https://
|
|
5697
|
+
example: 'curl https://api.stigg.io/api/v1-beta/entity-types \\\n -H "X-API-KEY: $STIGG_API_KEY"',
|
|
5594
5698
|
},
|
|
5595
5699
|
},
|
|
5596
5700
|
},
|
|
@@ -5639,7 +5743,7 @@ const EMBEDDED_METHODS = [
|
|
|
5639
5743
|
example: 'EntityTypeUpsertParams parameters = new()\n{\n Types =\n [\n new()\n {\n ID = "org",\n AttributionKeys =\n [\n "organizationId"\n ],\n DisplayName = "Organization",\n },\n new()\n {\n ID = "team",\n AttributionKeys =\n [\n "teamId"\n ],\n DisplayName = "Team",\n },\n ],\n};\n\nvar response = await client.V1Beta.EntityTypes.Upsert(parameters);\n\nConsole.WriteLine(response);',
|
|
5640
5744
|
},
|
|
5641
5745
|
http: {
|
|
5642
|
-
example: 'curl https://
|
|
5746
|
+
example: '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 }\'',
|
|
5643
5747
|
},
|
|
5644
5748
|
},
|
|
5645
5749
|
},
|
|
@@ -5659,7 +5763,7 @@ const EMBEDDED_READMES = [
|
|
|
5659
5763
|
},
|
|
5660
5764
|
{
|
|
5661
5765
|
language: 'java',
|
|
5662
|
-
content: '# 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',
|
|
5766
|
+
content: '# 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',
|
|
5663
5767
|
},
|
|
5664
5768
|
{
|
|
5665
5769
|
language: 'python',
|