Skip to content

Commit daad01a

Browse files
authored
Update openapi.yaml
1 parent cf0304c commit daad01a

File tree

1 file changed

+82
-65
lines changed

1 file changed

+82
-65
lines changed

openapi/openapi.yaml

Lines changed: 82 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@
2626
"name": "debug",
2727
"description": "Flag to enable additional debug information in the endpoint response",
2828
"schema": {
29-
"type": "string",
30-
"enum": [
31-
"true",
32-
"false"
33-
],
34-
"default": "false"
29+
"$ref": "#/components/schemas/Debug"
3530
}
3631
},
3732
{
@@ -401,7 +396,7 @@
401396
"get": {
402397
"parameters": [
403398
{
404-
"$ref": "#/components/parameters/EntryType"
399+
"$ref": "#/components/parameters/EntryTypeParam"
405400
},
406401
{
407402
"$ref": "#/components/parameters/MinimumAmount"
@@ -445,7 +440,7 @@
445440
"get": {
446441
"parameters": [
447442
{
448-
"$ref": "#/components/parameters/EntryType"
443+
"$ref": "#/components/parameters/EntryTypeParam"
449444
},
450445
{
451446
"$ref": "#/components/parameters/MinimumAmount"
@@ -2004,6 +1999,7 @@
20041999
"format": "date-time"
20052000
},
20062001
"status": {
2002+
"$anchor": "subscription-status",
20072003
"type": "string",
20082004
"minLength": 1,
20092005
"enum": [
@@ -2153,6 +2149,7 @@
21532149
"example": "2022-01-01"
21542150
},
21552151
"external_marketplace": {
2152+
"$anchor": "external-marketplace",
21562153
"type": "string",
21572154
"description": "Optionally provide the name of the external marketplace that the subscription is attached to.",
21582155
"example": "google",
@@ -2215,52 +2212,59 @@
22152212
"data": {
22162213
"type": "array",
22172214
"items": {
2218-
"type": "object",
2219-
"properties": {
2220-
"id": {
2221-
"type": "string"
2222-
},
2223-
"model_type": {
2224-
"type": "string",
2225-
"enum": [
2226-
"usage"
2227-
],
2228-
"example": "usage"
2229-
},
2230-
"usage": {
2231-
"type": "array",
2232-
"items": {
2233-
"type": "object",
2234-
"properties": {
2235-
"quantity": {
2236-
"type": "string"
2237-
},
2238-
"timeframe_start": {
2239-
"type": "string",
2240-
"format": "date-time"
2241-
},
2242-
"timeframe_end": {
2243-
"type": "string",
2244-
"format": "date-time"
2245-
}
2246-
},
2247-
"required": [
2248-
"quantity",
2249-
"timeframe_start",
2250-
"timeframe_end"
2251-
]
2252-
}
2253-
}
2254-
},
2255-
"required": [
2256-
"id",
2257-
"model_type",
2258-
"usage"
2259-
]
2215+
"$ref": "#/components/schemas/Usage"
22602216
}
22612217
}
22622218
}
22632219
},
2220+
"Usage": {
2221+
"type": "object",
2222+
"properties": {
2223+
"id": {
2224+
"type": "string"
2225+
},
2226+
"model_type": {
2227+
"$anchor": "model-type",
2228+
"type": "string",
2229+
"enum": [
2230+
"usage"
2231+
],
2232+
"example": "usage"
2233+
},
2234+
"usage": {
2235+
"type": "array",
2236+
"items": {
2237+
"$ref": "#/components/schemas/UsageItem"
2238+
}
2239+
}
2240+
},
2241+
"required": [
2242+
"id",
2243+
"model_type",
2244+
"usage"
2245+
]
2246+
},
2247+
"UsageItem": {
2248+
"type": "object",
2249+
"properties": {
2250+
"quantity": {
2251+
"type": "string"
2252+
},
2253+
"timeframe_start": {
2254+
"type": "string",
2255+
"format": "date-time"
2256+
},
2257+
"timeframe_end": {
2258+
"type": "string",
2259+
"format": "date-time"
2260+
}
2261+
},
2262+
"required": [
2263+
"quantity",
2264+
"timeframe_start",
2265+
"timeframe_end"
2266+
]
2267+
},
22642268
"SubscriptionCosts": {
22652269
"description": "",
22662270
"type": "object",
@@ -2369,6 +2373,7 @@
23692373
"type": "object",
23702374
"properties": {
23712375
"cancel_option": {
2376+
"$anchor": "cancel-options",
23722377
"type": "string",
23732378
"description": "Determines the timing of subscription cancellation",
23742379
"enum": [
@@ -2403,6 +2408,7 @@
24032408
"example": "ZMwNQefe7J3ecf7W"
24042409
},
24052410
"change_option": {
2411+
"$anchor": "change-options",
24062412
"type": "string",
24072413
"enum": [
24082414
"requested_date",
@@ -2507,6 +2513,7 @@
25072513
"example": "mqBkze6HoCwL4ytV"
25082514
},
25092515
"model_type": {
2516+
"$anchor": "tiered-model-type",
25102517
"type": "string",
25112518
"enum": [
25122519
"tiered"
@@ -2558,6 +2565,7 @@
25582565
"type": "string"
25592566
},
25602567
"model_type": {
2568+
"$anchor": "unit-model-type",
25612569
"type": "string",
25622570
"enum": [
25632571
"unit"
@@ -2595,6 +2603,7 @@
25952603
"type": "string"
25962604
},
25972605
"model_type": {
2606+
"$anchor": "bulk-model-type",
25982607
"type": "string",
25992608
"enum": [
26002609
"bulk"
@@ -2647,6 +2656,7 @@
26472656
},
26482657
"model_type": {
26492658
"type": "string",
2659+
"$anchor": "package-model-type",
26502660
"enum": [
26512661
"package"
26522662
],
@@ -2688,6 +2698,7 @@
26882698
},
26892699
"model_type": {
26902700
"type": "string",
2701+
"$anchor": "bps-model-type",
26912702
"enum": [
26922703
"bps"
26932704
],
@@ -2728,6 +2739,7 @@
27282739
},
27292740
"model_type": {
27302741
"type": "string",
2742+
"$anchor": "bulk-bps-model-type",
27312743
"enum": [
27322744
"bulk_bps"
27332745
],
@@ -2779,6 +2791,7 @@
27792791
},
27802792
"model_type": {
27812793
"type": "string",
2794+
"$anchor": "tiered-bps-model-type",
27822795
"enum": [
27832796
"tiered_bps"
27842797
],
@@ -2847,6 +2860,7 @@
28472860
"example": "\"2022-12-21\""
28482861
},
28492862
"change_option": {
2863+
"$anchor": "fee-change_option",
28502864
"type": "string",
28512865
"x-stoplight": {
28522866
"id": "exiyopgavm7qn"
@@ -2971,6 +2985,7 @@
29712985
}
29722986
},
29732987
"PaymentProvider": {
2988+
"$anchor": "payment-provider",
29742989
"type": [
29752990
"string",
29762991
"null"
@@ -3215,6 +3230,7 @@
32153230
"description": "If the Price represents a fixed cost, this represents the quantity of units applied. Mutually exclusive with billable_metric."
32163231
},
32173232
"cadence": {
3233+
"$anchor": "cadence",
32183234
"type": "string",
32193235
"enum": [
32203236
"annual",
@@ -4785,13 +4801,7 @@
47854801
"description": "The number of credits to effect. Note that this is required for increment or decrement operations."
47864802
},
47874803
"entry_type": {
4788-
"$anchor": "entry_type",
4789-
"type": "string",
4790-
"enum": [
4791-
"increment",
4792-
"decrement",
4793-
"expiration_change"
4794-
]
4804+
"$ref": "#/components/schemas/EntryType"
47954805
},
47964806
"expiry_date": {
47974807
"type": "string",
@@ -5423,6 +5433,7 @@
54235433
"example": "Product unsatisfactory"
54245434
},
54255435
"type": {
5436+
"$anchor": "adjustment_type",
54265437
"type": "string",
54275438
"x-stoplight": {
54285439
"id": "1n41ak4btp9e5"
@@ -5826,6 +5837,16 @@
58265837
"validation_failed"
58275838
]
58285839
},
5840+
"EntryType": {
5841+
"$anchor": "entry_type",
5842+
"type": "string",
5843+
"enum": [
5844+
"increment",
5845+
"decrement",
5846+
"expiration_change",
5847+
"credit_block_expiry"
5848+
]
5849+
},
58295850
"Debug": {
58305851
"type": "object",
58315852
"description": "Optional debug information (only present when debug=true is passed to the endpoint). Contains ingested and duplicate event idempotency keys.",
@@ -5976,6 +5997,7 @@
59765997
]
59775998
}
59785999
},
6000+
59796001
"securitySchemes": {
59806002
"APIKeyAuth": {
59816003
"bearerFormat": "auth-scheme",
@@ -6026,15 +6048,9 @@
60266048
"name": "group_by",
60276049
"description": "Groups per-price costs by the key provided."
60286050
},
6029-
"EntryType": {
6051+
"EntryTypeParam": {
60306052
"schema": {
6031-
"type": "string",
6032-
"enum": [
6033-
"increment",
6034-
"decrement",
6035-
"expiration_change",
6036-
"credit_block_expiry"
6037-
]
6053+
"$ref:": "#/components/schemas/EntryType"
60386054
},
60396055
"in": "query",
60406056
"name": "entry_type",
@@ -6050,6 +6066,7 @@
60506066
},
60516067
"EntryStatus": {
60526068
"schema": {
6069+
"$anchor": "entry_status",
60536070
"type": "string",
60546071
"enum": [
60556072
"committed",

0 commit comments

Comments
 (0)