infrawrench-sdk 1.7.0 → 1.9.0

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.
@@ -1,7 +1,7 @@
1
- # infrawrench-sdk v1.7.0 | MIT | Copyright (c) 2026 Infrawrench LLC
1
+ # infrawrench-sdk v1.9.0 | MIT | Copyright (c) 2026 Infrawrench LLC
2
2
  # https://github.com/Infrawrench/Infrawrench
3
3
  #
4
- # Generated from the Infrawrench API OpenAPI 3.1 spec (API version 1.7.0).
4
+ # Generated from the Infrawrench API OpenAPI 3.1 spec (API version 1.9.0).
5
5
  #
6
6
  # DO NOT EDIT. Regenerate with:
7
7
  # pnpm --filter @infrawrench/web generate:sdk
@@ -316,6 +316,9 @@ module Infrawrench
316
316
  | "budgetAlerts"
317
317
  | "anomalyAlerts"
318
318
  | "costChangeAlerts"
319
+ | "commitmentExpiryAlerts"
320
+ | "commitmentIdleAlerts"
321
+ | "unitCostRegressionAlerts"
319
322
  | "metricAlerts"
320
323
  | "resourceDrift"
321
324
  | "workflowPages"
@@ -415,7 +418,9 @@ module Infrawrench
415
418
  "ipAddress" => String | nil,
416
419
  "createdAt" => String,
417
420
  "userName" => String | nil,
418
- "userEmail" => String | nil
421
+ "userEmail" => String | nil,
422
+ "apiKeyName" => String | nil,
423
+ "apiKeyPrefix" => String | nil
419
424
  }
420
425
 
421
426
  # Spec schema: `AuditResponse`.
@@ -449,6 +454,62 @@ module Infrawrench
449
454
  # Spec schema: `BastionStatus`.
450
455
  type bastion_status = "pending" | "active" | "revoked"
451
456
 
457
+ # Spec schema: `BillingRule`.
458
+ type billing_rule = {
459
+ "id" => String,
460
+ "name" => String,
461
+ "description" => String | nil,
462
+ "enabled" => bool,
463
+ "priority" => Integer,
464
+ "match" => billing_rule_match,
465
+ "adjustment" => billing_rule_adjustment,
466
+ "createdAt" => String,
467
+ "updatedAt" => String
468
+ }
469
+
470
+ # Spec schema: `BillingRuleAdjustment`.
471
+ type billing_rule_adjustment = {
472
+ "kind" => "percentage" | "fixed" | "reallocation",
473
+ ?"percent" => Numeric | nil,
474
+ ?"amount" => Numeric | nil,
475
+ ?"currency" => String | nil,
476
+ ?"period" => "daily" | "monthly" | nil,
477
+ ?"targetKind" => "cost_centre" | "account" | nil,
478
+ ?"targetId" => String | nil
479
+ }
480
+
481
+ # Spec schema: `BillingRuleInput`.
482
+ type billing_rule_input = {
483
+ "name" => String,
484
+ ?"description" => String | nil,
485
+ ?"enabled" => bool,
486
+ "priority" => Integer,
487
+ "match" => billing_rule_match,
488
+ "adjustment" => billing_rule_adjustment
489
+ }
490
+
491
+ # All set fields must match (AND); a rule with no fields matches all spend.
492
+ # The same vocabulary allocation rules use, plus chargeType.
493
+ #
494
+ # Spec schema: `BillingRuleMatch`.
495
+ type billing_rule_match = {
496
+ ?"tagKey" => String,
497
+ ?"tagValue" => String,
498
+ ?"accountId" => String,
499
+ ?"pluginId" => String,
500
+ ?"service" => String,
501
+ ?"chargeType" => "usage"
502
+ | "commitment_covered_usage"
503
+ | "commitment_fee"
504
+ | "commitment_discount"
505
+ | "credit"
506
+ | "tax"
507
+ | "refund"
508
+ | "adjustment"
509
+ | "support"
510
+ | "other"
511
+ }
512
+
452
513
  # Spec schema: `BillingStatus`.
453
514
  type billing_status = { "complimentary" => bool, "subscription" => subscription, "capacity" => capacity_status }
454
515
 
@@ -492,8 +553,10 @@ module Infrawrench
492
553
  "currency" => String,
493
554
  "filters" => Array[budget_cost_filter],
494
555
  "savedFilterId" => String | nil,
556
+ "scenarioModelId" => String | nil,
495
557
  "thresholds" => Array[budget_threshold],
496
558
  "costBasis" => budget_cost_basis & untyped,
559
+ "useAdjustedSpend" => bool,
497
560
  "createdByUserId" => String | nil,
498
561
  "deletedAt" => String | nil,
499
562
  "createdAt" => String,
@@ -507,8 +570,10 @@ module Infrawrench
507
570
  ?"currency" => String,
508
571
  ?"filters" => Array[budget_cost_filter],
509
572
  ?"savedFilterId" => String,
573
+ ?"scenarioModelId" => String,
510
574
  "thresholds" => Array[budget_threshold],
511
- ?"costBasis" => budget_cost_basis & untyped
575
+ ?"costBasis" => budget_cost_basis & untyped,
576
+ ?"useAdjustedSpend" => bool
512
577
  }
513
578
 
514
579
  # Spec schema: `BudgetThreshold`.
@@ -524,9 +589,14 @@ module Infrawrench
524
589
  "thresholds" => Array[budget_threshold],
525
590
  "costBasis" => budget_cost_basis,
526
591
  "savedFilterId" => String | nil,
592
+ "scenarioModelId" => String | nil,
593
+ "scenarioModelName" => String | nil,
594
+ "useAdjustedSpend" => bool,
595
+ "rawActualCents" => Integer | nil,
527
596
  "month" => String,
528
597
  "actualCents" => Integer,
529
598
  "forecastCents" => Integer | nil,
599
+ "scenarioForecastCents" => Integer | nil,
530
600
  "currentMonthEvents" => Array[{
531
601
  "id" => String,
532
602
  "thresholdType" => "actual" | "forecast",
@@ -536,6 +606,71 @@ module Infrawrench
536
606
  "placements" => Array[{ "widgetId" => String, "dashboardId" => String, "dashboardName" => String }]
537
607
  }
538
608
 
609
+ # Spec schema: `BusinessMetric`.
610
+ type business_metric = {
611
+ "id" => String,
612
+ "key" => String,
613
+ "name" => String,
614
+ "unit" => String,
615
+ "description" => String | nil,
616
+ "kind" => business_metric_kind,
617
+ "currency" => String | nil,
618
+ "costScope" => Array[business_metric_scope_term],
619
+ "savedFilterId" => String | nil,
620
+ "createdByUserId" => String | nil,
621
+ "createdAt" => String,
622
+ "updatedAt" => String,
623
+ "coverage" => business_metric_coverage
624
+ }
625
+
626
+ # Null when the metric has no values at all — not an error, but every
627
+ # unit-cost chart drawn from it is one continuous gap.
628
+ #
629
+ # Spec schema: `BusinessMetricCoverage`.
630
+ type business_metric_coverage = { "firstDay" => String, "lastDay" => String, "reportedDays" => Integer } | nil
631
+
632
+ # Spec schema: `BusinessMetricInput`.
633
+ type business_metric_input = {
634
+ "key" => String,
635
+ "name" => String,
636
+ "unit" => String,
637
+ ?"description" => String,
638
+ "kind" => business_metric_kind,
639
+ ?"currency" => String,
640
+ ?"costScope" => Array[business_metric_scope_term],
641
+ ?"savedFilterId" => String
642
+ }
643
+
644
+ # What the metric's numbers are. `count` is a unit-less quantity (customers,
645
+ # requests, GB) and supports unit cost only. `currency` is money the business
646
+ # took in, denominated in the metric's own `currency`, and is the only kind
647
+ # margin can be computed against — `(revenue − cost) ÷ revenue` subtracts
648
+ # money from money and is undefined otherwise.
649
+ #
650
+ # Spec schema: `BusinessMetricKind`.
651
+ type business_metric_kind = "count" | "currency"
652
+
653
+ # Spec schema: `BusinessMetricScopeTerm`.
654
+ type business_metric_scope_term = {
655
+ "dimension" => "provider"
656
+ | "account"
657
+ | "service"
658
+ | "region"
659
+ | "resource"
660
+ | "tag"
661
+ | "charge_type"
662
+ | "commitment",
663
+ "op" => "in" | "not_in",
664
+ "values" => Array[String],
665
+ ?"tagKey" => String
666
+ }
667
+
668
+ # Spec schema: `BusinessMetricValue`.
669
+ type business_metric_value = { "day" => String, "value" => Numeric, "source" => "api" | "workflow", "updatedAt" => String }
670
+
671
+ # Spec schema: `BusinessMetricValuesInput`.
672
+ type business_metric_values_input = { "values" => Array[{ "date" => String, "value" => Numeric }] }
673
+
539
674
  # Spec schema: `CapacityCheckoutRequest`.
540
675
  type capacity_checkout_request = { ?"quantity" => Integer }
541
676
 
@@ -795,6 +930,23 @@ module Infrawrench
795
930
  "coverage" => { "firstDay" => String, "lastDay" => String } | nil
796
931
  }
797
932
 
933
+ # What an adjusted answer did. Present whenever the request asked to be
934
+ # adjusted, even for an organisation with no rules — its absence means, and
935
+ # can only mean, that every figure in the response is exactly what the
936
+ # providers charged.
937
+ #
938
+ # Spec schema: `CostAdjustmentSummary`.
939
+ type cost_adjustment_summary = {
940
+ "rules" => Array[{
941
+ "id" => String,
942
+ "name" => String,
943
+ "kind" => "percentage" | "fixed" | "reallocation",
944
+ "summary" => String
945
+ }],
946
+ "rawTotals" => Hash[String, Numeric],
947
+ "fixedTotals" => Hash[String, Numeric]
948
+ }
949
+
798
950
  # A change-based cost alert: fires when spend on its scope moves more than the
799
951
  # configured threshold versus the prior period. The third alert family
800
952
  # alongside budgets (absolute monthly total) and anomaly detection
@@ -882,6 +1034,26 @@ module Infrawrench
882
1034
  ?"enabled" => bool
883
1035
  }
884
1036
 
1037
+ # Spec schema: `CostAnnotation`.
1038
+ type cost_annotation = {
1039
+ "id" => String,
1040
+ "startDate" => String,
1041
+ "endDate" => String | nil,
1042
+ "text" => String,
1043
+ "costReportId" => String | nil,
1044
+ "createdByUserId" => String | nil,
1045
+ "createdAt" => String,
1046
+ "updatedAt" => String
1047
+ }
1048
+
1049
+ # Spec schema: `CostAnnotationInput`.
1050
+ type cost_annotation_input = {
1051
+ "startDate" => String,
1052
+ ?"endDate" => String | nil,
1053
+ "text" => String,
1054
+ ?"costReportId" => String | nil
1055
+ }
1056
+
885
1057
  # Spec schema: `CostAnomaly`.
886
1058
  type cost_anomaly = {
887
1059
  "id" => String,
@@ -924,12 +1096,13 @@ module Infrawrench
924
1096
  "id" => String,
925
1097
  "name" => String,
926
1098
  "description" => String | nil,
1099
+ "parentId" => String | nil,
927
1100
  "createdAt" => String,
928
1101
  "updatedAt" => String
929
1102
  }
930
1103
 
931
1104
  # Spec schema: `CostCentreInput`.
932
- type cost_centre_input = { "name" => String, ?"description" => String }
1105
+ type cost_centre_input = { "name" => String, ?"description" => String, ?"parentId" => String | nil }
933
1106
 
934
1107
  # Which window is compared to which, in complete UTC days (the accruing
935
1108
  # current day never counts). daily: one complete day vs the same weekday one
@@ -979,6 +1152,23 @@ module Infrawrench
979
1152
  # Spec schema: `CostDimensionValues`.
980
1153
  type cost_dimension_values = { "values" => Array[String | { "value" => String, "label" => String }] }
981
1154
 
1155
+ # Spec schema: `CostEfficiencySettings`.
1156
+ type cost_efficiency_settings = {
1157
+ "commitmentExpiryEnabled" => bool,
1158
+ "commitmentExpiryHorizonDays" => Array[Integer],
1159
+ "commitmentExpiryAlertOnExpired" => bool,
1160
+ "commitmentIdleEnabled" => bool,
1161
+ "commitmentIdleThresholdPercent" => Integer,
1162
+ "commitmentIdleWindowDays" => Integer,
1163
+ "commitmentIdleMinMeasuredDays" => Integer,
1164
+ "commitmentIdleMinWasteCents" => Integer,
1165
+ "unitCostRegressionEnabled" => bool,
1166
+ "unitCostThresholdPercent" => Integer,
1167
+ "unitCostWindowDays" => Integer,
1168
+ "unitCostMinReportedDays" => Integer,
1169
+ "unitCostMinSpendCents" => Integer
1170
+ }
1171
+
982
1172
  # Spec schema: `CostEstimate`.
983
1173
  type cost_estimate = {
984
1174
  "monthlyAmount" => Numeric,
@@ -1157,6 +1347,7 @@ module Infrawrench
1157
1347
  ?"topN" => Integer,
1158
1348
  ?"comparePreviousPeriod" => bool,
1159
1349
  ?"showForecast" => bool,
1350
+ ?"scenarioModelId" => String,
1160
1351
  ?"costBasis" => "cash" | "amortized"
1161
1352
  }
1162
1353
 
@@ -1187,8 +1378,10 @@ module Infrawrench
1187
1378
  ?"topN" => Integer,
1188
1379
  ?"comparePreviousPeriod" => bool,
1189
1380
  ?"forecast" => bool,
1381
+ ?"scenarioModelId" => String,
1190
1382
  ?"costBasis" => cost_basis,
1191
- ?"chargeTypes" => Array[cost_charge_type]
1383
+ ?"chargeTypes" => Array[cost_charge_type],
1384
+ ?"adjusted" => bool
1192
1385
  }
1193
1386
 
1194
1387
  # Spec schema: `CostQueryResponse`.
@@ -1196,9 +1389,11 @@ module Infrawrench
1196
1389
  "series" => Array[cost_query_series],
1197
1390
  ?"comparison" => Array[cost_query_series],
1198
1391
  ?"forecast" => Array[cost_series_point],
1392
+ ?"scenario" => cost_scenario_result,
1199
1393
  "currencies" => Array[String],
1200
1394
  "totals" => Hash[String, Numeric],
1201
- ?"previousTotals" => Hash[String, Numeric]
1395
+ ?"previousTotals" => Hash[String, Numeric],
1396
+ ?"adjustment" => cost_adjustment_summary
1202
1397
  }
1203
1398
 
1204
1399
  # Spec schema: `CostQuerySeries`.
@@ -1269,6 +1464,81 @@ module Infrawrench
1269
1464
  "result" => cost_query_response
1270
1465
  }
1271
1466
 
1467
+ # Spec schema: `CostScenarioAdjustment`.
1468
+ type cost_scenario_adjustment = {
1469
+ "id" => String,
1470
+ "label" => String,
1471
+ "kind" => "one_off" | "recurring" | "rate_change",
1472
+ "startDate" => String,
1473
+ "endDate" => String | nil,
1474
+ "amountCents" => Integer | nil,
1475
+ "currency" => String | nil,
1476
+ "period" => "daily" | "monthly" | nil,
1477
+ "percent" => Numeric | nil,
1478
+ "scope" => Array[cost_scenario_scope_term]
1479
+ }
1480
+
1481
+ # Spec schema: `CostScenarioModel`.
1482
+ type cost_scenario_model = {
1483
+ "id" => String,
1484
+ "name" => String,
1485
+ "description" => String | nil,
1486
+ "currency" => String,
1487
+ "adjustments" => Array[cost_scenario_adjustment],
1488
+ "createdByUserId" => String | nil,
1489
+ "createdAt" => String,
1490
+ "updatedAt" => String
1491
+ }
1492
+
1493
+ # Spec schema: `CostScenarioModelInput`.
1494
+ type cost_scenario_model_input = {
1495
+ "name" => String,
1496
+ ?"description" => String,
1497
+ "currency" => String,
1498
+ "adjustments" => Array[cost_scenario_adjustment]
1499
+ }
1500
+
1501
+ # Spec schema: `CostScenarioReferent`.
1502
+ type cost_scenario_referent = {
1503
+ "kind" => "budget" | "cost_report" | "cost_graph_widget",
1504
+ "id" => String,
1505
+ "name" => String,
1506
+ ?"dashboardId" => String,
1507
+ ?"dashboardName" => String
1508
+ }
1509
+
1510
+ # Spec schema: `CostScenarioResult`.
1511
+ type cost_scenario_result = {
1512
+ "modelId" => String,
1513
+ "modelName" => String,
1514
+ "currency" => String,
1515
+ "points" => Array[cost_series_point],
1516
+ "contributions" => Array[{
1517
+ "adjustmentId" => String,
1518
+ "label" => String,
1519
+ "kind" => "one_off" | "recurring" | "rate_change",
1520
+ "amount" => Numeric
1521
+ }],
1522
+ "totalDelta" => Numeric,
1523
+ ?"convertedFrom" => String,
1524
+ "outOfScope" => Array[String]
1525
+ }
1526
+
1527
+ # Spec schema: `CostScenarioScopeTerm`.
1528
+ type cost_scenario_scope_term = {
1529
+ "dimension" => "provider"
1530
+ | "account"
1531
+ | "service"
1532
+ | "region"
1533
+ | "resource"
1534
+ | "tag"
1535
+ | "charge_type"
1536
+ | "commitment",
1537
+ "op" => "in" | "not_in",
1538
+ "values" => Array[String],
1539
+ ?"tagKey" => String
1540
+ }
1541
+
1272
1542
  # Spec schema: `CostSeriesPoint`.
1273
1543
  type cost_series_point = { "bucket" => String, "amount" => Numeric }
1274
1544
 
@@ -1959,6 +2229,20 @@ module Infrawrench
1959
2229
  ?"enumValues" => Array[String]
1960
2230
  }
1961
2231
 
2232
+ # Spec schema: `EfficiencyAlertEvent`.
2233
+ type efficiency_alert_event = {
2234
+ "id" => String,
2235
+ "kind" => "commitment_expiry" | "commitment_idle" | "unit_cost_regression",
2236
+ "subject" => String,
2237
+ "accountId" => String | nil,
2238
+ "accountName" => String | nil,
2239
+ "currency" => String | nil,
2240
+ "amount" => Numeric | nil,
2241
+ "detail" => Hash[String, String | Numeric | nil | nil],
2242
+ "firedAt" => String,
2243
+ "notifiedAt" => String | nil
2244
+ }
2245
+
1962
2246
  # Spec schema: `EnvironmentDiffEntry`.
1963
2247
  type environment_diff_entry = {
1964
2248
  "key" => String,
@@ -2228,6 +2512,171 @@ module Infrawrench
2228
2512
  # Spec schema: `InviteResponse`.
2229
2513
  type invite_response = { "id" => String, "token" => String }
2230
2514
 
2515
+ # Spec schema: `Invoice`.
2516
+ type invoice = invoice_summary
2517
+ & {
2518
+ ?"totals" => invoice_totals & Hash[String, untyped],
2519
+ "notes" => String | nil,
2520
+ "lines" => Array[invoice_line],
2521
+ "derivation" => invoice_derivation,
2522
+ "live" => bool,
2523
+ "computedAt" => String,
2524
+ "approvedByUserId" => String | nil,
2525
+ "sentByUserId" => String | nil,
2526
+ "voidedByUserId" => String | nil,
2527
+ "createdByUserId" => String | nil
2528
+ }
2529
+
2530
+ # The last delivery attempt, or null when none has been made — including on an
2531
+ # invoice marked sent by a deployment with no mail provider. “A person
2532
+ # released this” and “we delivered it” are different claims, and this field is
2533
+ # only ever the second.
2534
+ #
2535
+ # Spec schema: `InvoiceDelivery`.
2536
+ type invoice_delivery = {
2537
+ "status" => "pending" | "succeeded" | "partial" | "failed" | "no_targets",
2538
+ "recipients" => Array[String],
2539
+ "delivered" => Integer,
2540
+ "attemptedAt" => String,
2541
+ "deliveredAt" => String | nil,
2542
+ "attempts" => Integer,
2543
+ "error" => String | nil
2544
+ }
2545
+ | nil
2546
+
2547
+ # Everything needed to re-derive the invoice by hand. Not decoration: an
2548
+ # invoice a customer cannot reconcile is an invoice a customer does not pay.
2549
+ #
2550
+ # Spec schema: `InvoiceDerivation`.
2551
+ type invoice_derivation = {
2552
+ "costBasis" => "cash" | "amortized",
2553
+ "applyBillingRules" => bool,
2554
+ "rateDate" => String,
2555
+ "rates" => Array[{ "currency" => String, "rate" => Numeric, "effectiveFrom" => String }],
2556
+ "unconverted" => Array[String],
2557
+ "rules" => Array[{
2558
+ "id" => String,
2559
+ "name" => String,
2560
+ "kind" => "percentage" | "fixed" | "reallocation",
2561
+ "summary" => String
2562
+ }],
2563
+ "scope" => {
2564
+ "costCentres" => Array[{ "id" => String, "name" => String }],
2565
+ "accounts" => Array[{ "id" => String, "label" => String }]
2566
+ },
2567
+ "missingScope" => Array[String]
2568
+ }
2569
+
2570
+ # A new invoice is always a draft. There is no status field and no scope
2571
+ # field: generating and issuing are two acts, and the scope comes from the
2572
+ # customer.
2573
+ #
2574
+ # Spec schema: `InvoiceInput`.
2575
+ type invoice_input = {
2576
+ "managedAccountId" => String,
2577
+ "periodFrom" => String,
2578
+ "periodTo" => String,
2579
+ ?"notes" => String | nil,
2580
+ ?"supersedesInvoiceId" => String | nil
2581
+ }
2582
+
2583
+ # One scope entry in one collected currency. Two currencies for one cost
2584
+ # centre are two lines, not one blended line, because the conversion is a
2585
+ # separately reconcilable step.
2586
+ #
2587
+ # Spec schema: `InvoiceLine`.
2588
+ type invoice_line = {
2589
+ "kind" => "cost_centre" | "account" | "fixed",
2590
+ "refId" => String | nil,
2591
+ "label" => String,
2592
+ "currency" => String,
2593
+ "collected" => Numeric,
2594
+ "adjustment" => Numeric,
2595
+ "adjusted" => Numeric,
2596
+ "rate" => Numeric | nil,
2597
+ "billed" => Numeric | nil
2598
+ }
2599
+
2600
+ # Spec schema: `InvoiceSendRequest`.
2601
+ type invoice_send_request = { ?"resend" => bool }
2602
+
2603
+ # `draft` → `approved` → `sent`, plus `void` from either issued state.
2604
+ #
2605
+ # **A draft recomputes its figures from live spend on every read; an approved,
2606
+ # sent or void invoice never does.** Approval is the freeze: the lines, the
2607
+ # totals, the exchange rates and the day they were read, the billing rules in
2608
+ # force and the names of everything in scope are written onto the invoice, and
2609
+ # no later restatement of spend, change of rate, edit of a rule or rename can
2610
+ # alter what the document says.
2611
+ #
2612
+ # An issued invoice is never edited and never deleted. A wrong one is voided
2613
+ # with a reason and superseded by a corrective invoice; both survive. The
2614
+ # server enforces this, not just the UI.
2615
+ #
2616
+ # Spec schema: `InvoiceStatus`.
2617
+ type invoice_status = "draft" | "approved" | "sent" | "void"
2618
+
2619
+ # Spec schema: `InvoiceSummary`.
2620
+ type invoice_summary = {
2621
+ "id" => String,
2622
+ "managedAccountId" => String,
2623
+ "managedAccountName" => String,
2624
+ "number" => String | nil,
2625
+ "status" => invoice_status,
2626
+ "periodFrom" => String,
2627
+ "periodTo" => String,
2628
+ "currency" => String,
2629
+ "totals" => invoice_totals,
2630
+ "issuedAt" => String | nil,
2631
+ "sentAt" => String | nil,
2632
+ "delivery" => invoice_delivery,
2633
+ "voidedAt" => String | nil,
2634
+ "voidReason" => String | nil,
2635
+ "supersedesInvoiceId" => String | nil,
2636
+ "supersededByInvoiceId" => String | nil,
2637
+ "createdAt" => String,
2638
+ "updatedAt" => String
2639
+ }
2640
+
2641
+ # **Null for a draft** — null, not zero. A draft's figures are recomputed on
2642
+ # read and the list does not recompute; fetch the invoice by id for a draft's
2643
+ # current numbers.
2644
+ #
2645
+ # Spec schema: `InvoiceTotals`.
2646
+ type invoice_totals = {
2647
+ "collected" => Hash[String, Numeric],
2648
+ "adjustment" => Hash[String, Numeric],
2649
+ "adjusted" => Hash[String, Numeric],
2650
+ "billed" => Hash[String, Numeric]
2651
+ }
2652
+ | nil
2653
+
2654
+ # Spec schema: `InvoiceUpdate`.
2655
+ type invoice_update = { "periodFrom" => String, "periodTo" => String, ?"notes" => String | nil }
2656
+
2657
+ # Spec schema: `InvoiceVoidRequest`.
2658
+ type invoice_void_request = { "reason" => String, ?"supersede" => bool }
2659
+
2660
+ # Spec schema: `InvoiceVoidResponse`.
2661
+ type invoice_void_response = {
2662
+ "invoice" => invoice,
2663
+ "replacement" => invoice
2664
+ & invoice_summary
2665
+ & ({
2666
+ ?"totals" => invoice_totals & Hash[String, untyped],
2667
+ "notes" => String | nil,
2668
+ "lines" => Array[invoice_line],
2669
+ "derivation" => invoice_derivation,
2670
+ "live" => bool,
2671
+ "computedAt" => String,
2672
+ "approvedByUserId" => String | nil,
2673
+ "sentByUserId" => String | nil,
2674
+ "voidedByUserId" => String | nil,
2675
+ "createdByUserId" => String | nil
2676
+ }
2677
+ | nil)
2678
+ }
2679
+
2231
2680
  # Spec schema: `InvokeActionRequest`.
2232
2681
  type invoke_action_request = {
2233
2682
  "pluginId" => String,
@@ -2432,6 +2881,43 @@ module Infrawrench
2432
2881
  # Spec schema: `LogsResponse`.
2433
2882
  type logs_response = { "text" => String, "containers" => Array[String], "activeContainer" => String }
2434
2883
 
2884
+ # A customer a managed service provider bills. A cost centre or cloud account
2885
+ # belongs to at most one managed account — billing the same money to two
2886
+ # customers is refused at write time with a 409 naming the other customer.
2887
+ #
2888
+ # Spec schema: `ManagedAccount`.
2889
+ type managed_account = {
2890
+ "id" => String,
2891
+ "name" => String,
2892
+ "contactName" => String | nil,
2893
+ "contactEmail" => String | nil,
2894
+ "billingAddress" => String | nil,
2895
+ "billingCurrency" => String,
2896
+ "costBasis" => "cash" | "amortized",
2897
+ "applyBillingRules" => bool,
2898
+ "notes" => String | nil,
2899
+ "costCentreIds" => Array[String],
2900
+ "accountIds" => Array[String],
2901
+ "invoiceCount" => Integer,
2902
+ "createdByUserId" => String | nil,
2903
+ "createdAt" => String,
2904
+ "updatedAt" => String
2905
+ }
2906
+
2907
+ # Spec schema: `ManagedAccountInput`.
2908
+ type managed_account_input = {
2909
+ "name" => String,
2910
+ ?"contactName" => String | nil,
2911
+ ?"contactEmail" => String | nil,
2912
+ ?"billingAddress" => String | nil,
2913
+ "billingCurrency" => String,
2914
+ ?"costBasis" => "cash" | "amortized",
2915
+ ?"applyBillingRules" => bool,
2916
+ ?"notes" => String | nil,
2917
+ ?"costCentreIds" => Array[String],
2918
+ ?"accountIds" => Array[String]
2919
+ }
2920
+
2435
2921
  # Spec schema: `Manifest`.
2436
2922
  type manifest = { "manifest" => String }
2437
2923
 
@@ -3119,6 +3605,9 @@ module Infrawrench
3119
3605
  | "jira:write"
3120
3606
  | "linear:read"
3121
3607
  | "linear:write"
3608
+ | "invoices:read"
3609
+ | "invoices:write"
3610
+ | "invoices:issue"
3122
3611
  | "pages:write"
3123
3612
  | "org:settings:write"
3124
3613
 
@@ -4388,7 +4877,15 @@ module Infrawrench
4388
4877
  "from" => String,
4389
4878
  "to" => String,
4390
4879
  "currencies" => Array[String],
4391
- "centres" => Array[{ "costCentreId" => String | nil, "name" => String, "totals" => Hash[String, Numeric] }]
4880
+ ?"adjustment" => cost_adjustment_summary & untyped,
4881
+ "centres" => Array[{
4882
+ "costCentreId" => String | nil,
4883
+ "name" => String,
4884
+ "totals" => Hash[String, Numeric],
4885
+ "subtreeTotals" => Hash[String, Numeric],
4886
+ "parentId" => String | nil,
4887
+ "depth" => Integer
4888
+ }]
4392
4889
  }
4393
4890
 
4394
4891
  # Spec schema: `SlackAvailableChannel`.
@@ -4807,6 +5304,7 @@ module Infrawrench
4807
5304
  | "costs"
4808
5305
  | "savings"
4809
5306
  | "cost-reports"
5307
+ | "invoices"
4810
5308
  | "graph"
4811
5309
  | "logs"
4812
5310
  | "changes"
@@ -4825,7 +5323,8 @@ module Infrawrench
4825
5323
  ?"accountId" => String,
4826
5324
  ?"resourceId" => resource_id,
4827
5325
  ?"conversationId" => String,
4828
- ?"reportId" => String
5326
+ ?"reportId" => String,
5327
+ ?"invoiceId" => String
4829
5328
  }
4830
5329
 
4831
5330
  # Spec schema: `TagComplianceReport`.
@@ -4879,6 +5378,65 @@ module Infrawrench
4879
5378
  "uri" => String | nil
4880
5379
  }
4881
5380
 
5381
+ # Spec schema: `UnitCostPoint`.
5382
+ type unit_cost_point = {
5383
+ "bucket" => String,
5384
+ "value" => Numeric | nil,
5385
+ "cost" => Numeric,
5386
+ "metricValue" => Numeric | nil,
5387
+ ?"gap" => "no_metric_value" | "non_positive_metric_value" | "unconvertible_currency",
5388
+ "reportedDays" => Integer,
5389
+ "bucketDays" => Integer
5390
+ }
5391
+
5392
+ # Spec schema: `UnitCostQueryRequest`.
5393
+ type unit_cost_query_request = {
5394
+ "from" => String,
5395
+ "to" => String,
5396
+ "binning" => "daily" | "weekly" | "monthly" | "cumulative",
5397
+ ?"mode" => "unit_cost" | "margin",
5398
+ ?"filters" => Array[business_metric_scope_term],
5399
+ ?"query" => String,
5400
+ ?"savedFilterId" => String,
5401
+ ?"costBasis" => "cash" | "amortized",
5402
+ ?"chargeTypes" => Array[String],
5403
+ ?"displayCurrency" => String
5404
+ }
5405
+
5406
+ # Spec schema: `UnitCostQueryResponse`.
5407
+ type unit_cost_query_response = {
5408
+ "metric" => {
5409
+ "id" => String,
5410
+ "key" => String,
5411
+ "name" => String,
5412
+ "unit" => String,
5413
+ "kind" => business_metric_kind,
5414
+ "currency" => String | nil
5415
+ },
5416
+ "mode" => "unit_cost" | "margin",
5417
+ "binning" => "daily" | "weekly" | "monthly" | "cumulative",
5418
+ "series" => Array[unit_cost_series],
5419
+ ?"conversion" => {
5420
+ "displayCurrency" => String,
5421
+ "converted" => Array[{
5422
+ "currency" => String,
5423
+ "rates" => Array[{ "effectiveFrom" => String, "rate" => Numeric }]
5424
+ }],
5425
+ "unconverted" => Array[String]
5426
+ },
5427
+ "gapBuckets" => Integer,
5428
+ "partialBuckets" => Integer
5429
+ }
5430
+
5431
+ # Spec schema: `UnitCostSeries`.
5432
+ type unit_cost_series = {
5433
+ "currency" => String,
5434
+ "points" => Array[unit_cost_point],
5435
+ "overallValue" => Numeric | nil,
5436
+ "overallCost" => Numeric,
5437
+ "overallMetricValue" => Numeric | nil
5438
+ }
5439
+
4882
5440
  # Spec schema: `UnpinRequest`.
4883
5441
  type unpin_request = { "dashboardId" => String, "resourceId" => resource_id }
4884
5442
 
@@ -5093,7 +5651,7 @@ module Infrawrench
5093
5651
 
5094
5652
  class AuditLogsNamespace
5095
5653
  def initialize: (Transport) -> void
5096
- def get: (?org_id: String?, ?page: Integer?, ?page_size: Integer?, ?action: String?, ?entity_type: String?, ?user_id: String?, ?from: String?, ?to: String?, ?request_options: Hash[Symbol, untyped]?) -> audit_response
5654
+ def get: (?org_id: String?, ?page: Integer?, ?page_size: Integer?, ?action: String?, ?entity_type: String?, ?user_id: String?, ?api_key_id: String?, ?from: String?, ?to: String?, ?request_options: Hash[Symbol, untyped]?) -> audit_response
5097
5655
  end
5098
5656
 
5099
5657
  class AuthNamespace
@@ -5122,6 +5680,15 @@ module Infrawrench
5122
5680
  def status: (?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> billing_status
5123
5681
  end
5124
5682
 
5683
+ class BillingRulesNamespace
5684
+ def initialize: (Transport) -> void
5685
+ def create: (body: billing_rule_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> billing_rule
5686
+ def delete: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> ok
5687
+ def get: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> billing_rule
5688
+ def list: (?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> Array[billing_rule]
5689
+ def update: (id: String, body: billing_rule_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> billing_rule
5690
+ end
5691
+
5125
5692
  class BudgetsNamespace
5126
5693
  def initialize: (Transport) -> void
5127
5694
  def create: (body: budget_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> budget_full
@@ -5132,6 +5699,28 @@ module Infrawrench
5132
5699
  def update: (id: String, body: budget_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> budget_full
5133
5700
  end
5134
5701
 
5702
+ class BusinessMetricsGetNamespace
5703
+ def initialize: (Transport) -> void
5704
+ def get: (?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> { "metrics" => Array[business_metric] }
5705
+ def get_org_org_id_business_metrics_id: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> business_metric
5706
+ end
5707
+
5708
+ class BusinessMetricsValuesNamespace
5709
+ def initialize: (Transport) -> void
5710
+ def create: (id: String, body: business_metric_values_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> { "written" => Integer }
5711
+ def get: (id: String, ?org_id: String?, ?limit: Integer?, ?request_options: Hash[Symbol, untyped]?) -> { "values" => Array[business_metric_value] }
5712
+ end
5713
+
5714
+ class BusinessMetricsNamespace
5715
+ attr_reader get: BusinessMetricsGetNamespace
5716
+ attr_reader values: BusinessMetricsValuesNamespace
5717
+ def initialize: (Transport) -> void
5718
+ def create: (body: business_metric_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> business_metric
5719
+ def delete: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> ok
5720
+ def unit_costs: (id: String, body: unit_cost_query_request, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> unit_cost_query_response
5721
+ def update: (id: String, body: business_metric_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> business_metric
5722
+ end
5723
+
5135
5724
  class ChangeFreezesNamespace
5136
5725
  def initialize: (Transport) -> void
5137
5726
  def create: (body: change_freeze_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> change_freeze
@@ -5189,6 +5778,14 @@ module Infrawrench
5189
5778
  def update: (id: String, body: cost_alert_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_alert
5190
5779
  end
5191
5780
 
5781
+ class CostAnnotationsNamespace
5782
+ def initialize: (Transport) -> void
5783
+ def create: (body: cost_annotation_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_annotation
5784
+ def delete: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> ok
5785
+ def get: (?org_id: String?, ?report_id: String?, ?request_options: Hash[Symbol, untyped]?) -> { "annotations" => Array[cost_annotation] }
5786
+ def update: (id: String, body: cost_annotation_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_annotation
5787
+ end
5788
+
5192
5789
  class CostCentresRulesNamespace
5193
5790
  def initialize: (Transport) -> void
5194
5791
  def create: (body: allocation_rule_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> allocation_rule
@@ -5251,20 +5848,43 @@ module Infrawrench
5251
5848
  def update: (id: String, body: cost_report_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_report
5252
5849
  end
5253
5850
 
5851
+ class CostScenariosGetNamespace
5852
+ def initialize: (Transport) -> void
5853
+ def get: (?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> { "models" => Array[cost_scenario_model] }
5854
+ def get_org_org_id_cost_scenarios_id: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_scenario_model
5855
+ end
5856
+
5857
+ class CostScenariosNamespace
5858
+ attr_reader get: CostScenariosGetNamespace
5859
+ def initialize: (Transport) -> void
5860
+ def create: (body: cost_scenario_model_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_scenario_model
5861
+ def delete: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> ok
5862
+ def referents: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> { "referents" => Array[cost_scenario_referent] }
5863
+ def update: (id: String, body: cost_scenario_model_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_scenario_model
5864
+ end
5865
+
5254
5866
  class CostsAnomalySettingsNamespace
5255
5867
  def initialize: (Transport) -> void
5256
5868
  def get: (?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_anomaly_settings_view
5257
5869
  def update: (body: cost_anomaly_settings, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_anomaly_settings_view
5258
5870
  end
5259
5871
 
5872
+ class CostsEfficiencyAlertSettingsNamespace
5873
+ def initialize: (Transport) -> void
5874
+ def get: (?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_efficiency_settings
5875
+ def update: (body: cost_efficiency_settings, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_efficiency_settings
5876
+ end
5877
+
5260
5878
  class CostsNamespace
5261
5879
  attr_reader anomaly_settings: CostsAnomalySettingsNamespace
5880
+ attr_reader efficiency_alert_settings: CostsEfficiencyAlertSettingsNamespace
5262
5881
  def initialize: (Transport) -> void
5263
5882
  def anomalies: (?org_id: String?, ?days: String?, ?request_options: Hash[Symbol, untyped]?) -> { "anomalies" => Array[cost_anomaly] }
5264
5883
  def dimensions: (dimension: "provider" | "account" | "service" | "region" | "resource" | "tag" | "charge_type" | "commitment" | "tag-keys", ?org_id: String?, ?tag_key: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_dimension_values
5884
+ def efficiency_alerts: (?org_id: String?, ?kind: "commitment_expiry" | "commitment_idle" | "unit_cost_regression"?, ?limit: Integer?, ?request_options: Hash[Symbol, untyped]?) -> { "events" => Array[efficiency_alert_event] }
5265
5885
  def query: (body: cost_query_request, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_query_response
5266
5886
  def rows: (body: cost_push_request, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> cost_push_response
5267
- def showback: (?org_id: String?, ?from: String?, ?to: String?, ?basis: "cash" | "amortized"?, ?request_options: Hash[Symbol, untyped]?) -> showback_report
5887
+ def showback: (?org_id: String?, ?from: String?, ?to: String?, ?basis: "cash" | "amortized"?, ?adjusted: "true" | "false"?, ?request_options: Hash[Symbol, untyped]?) -> showback_report
5268
5888
  def status: (?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> { "accounts" => Array[cost_account_status] }
5269
5889
  def untagged: (?org_id: String?, ?from: String?, ?to: String?, ?basis: "cash" | "amortized"?, ?request_options: Hash[Symbol, untyped]?) -> untagged_spend_report
5270
5890
  end
@@ -5424,6 +6044,19 @@ module Infrawrench
5424
6044
  def accept: (body: accept_invitation_request, ?request_options: Hash[Symbol, untyped]?) -> accept_invitation_response
5425
6045
  end
5426
6046
 
6047
+ class InvoicesNamespace
6048
+ def initialize: (Transport) -> void
6049
+ def approve: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> invoice
6050
+ def create: (body: invoice_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> invoice
6051
+ def delete: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> ok
6052
+ def export: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> String
6053
+ def get: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> invoice
6054
+ def list: (?org_id: String?, ?managed_account_id: String?, ?status: invoice_status?, ?request_options: Hash[Symbol, untyped]?) -> Array[invoice_summary]
6055
+ def post_org_org_id_invoices_id_send: (id: String, ?org_id: String?, ?body: invoice_send_request?, ?request_options: Hash[Symbol, untyped]?) -> invoice
6056
+ def update: (id: String, body: invoice_update, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> invoice
6057
+ def void: (id: String, body: invoice_void_request, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> invoice_void_response
6058
+ end
6059
+
5427
6060
  class JiraProjectsNamespace
5428
6061
  def initialize: (Transport) -> void
5429
6062
  def issue_types: (key: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> Array[jira_issue_type]
@@ -5476,6 +6109,15 @@ module Infrawrench
5476
6109
  def update: (query_id: String, body: log_workspace_query_update, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> log_workspace_query
5477
6110
  end
5478
6111
 
6112
+ class ManagedAccountsNamespace
6113
+ def initialize: (Transport) -> void
6114
+ def create: (body: managed_account_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> managed_account
6115
+ def delete: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> ok
6116
+ def get: (id: String, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> managed_account
6117
+ def list: (?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> Array[managed_account]
6118
+ def update: (id: String, body: managed_account_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> managed_account
6119
+ end
6120
+
5479
6121
  class MetricAlertsNamespace
5480
6122
  def initialize: (Transport) -> void
5481
6123
  def create: (body: metric_alert_rule_input, ?org_id: String?, ?request_options: Hash[Symbol, untyped]?) -> metric_alert_rule
@@ -5848,18 +6490,22 @@ module Infrawrench
5848
6490
  attr_reader auth: AuthNamespace
5849
6491
  attr_reader bastions: BastionsNamespace
5850
6492
  attr_reader billing: BillingNamespace
6493
+ attr_reader billing_rules: BillingRulesNamespace
5851
6494
  attr_reader budgets: BudgetsNamespace
6495
+ attr_reader business_metrics: BusinessMetricsNamespace
5852
6496
  attr_reader change_freezes: ChangeFreezesNamespace
5853
6497
  attr_reader changes: ChangesNamespace
5854
6498
  attr_reader commitments: CommitmentsNamespace
5855
6499
  attr_reader config: ConfigNamespace
5856
6500
  attr_reader connect: ConnectNamespace
5857
6501
  attr_reader cost_alerts: CostAlertsNamespace
6502
+ attr_reader cost_annotations: CostAnnotationsNamespace
5858
6503
  attr_reader cost_centres: CostCentresNamespace
5859
6504
  attr_reader cost_exports: CostExportsNamespace
5860
6505
  attr_reader cost_report_folders: CostReportFoldersNamespace
5861
6506
  attr_reader cost_report_notifications: CostReportNotificationsNamespace
5862
6507
  attr_reader cost_reports: CostReportsNamespace
6508
+ attr_reader cost_scenarios: CostScenariosNamespace
5863
6509
  attr_reader costs: CostsNamespace
5864
6510
  attr_reader credential_hygiene: CredentialHygieneNamespace
5865
6511
  attr_reader credits: CreditsNamespace
@@ -5874,11 +6520,13 @@ module Infrawrench
5874
6520
  attr_reader environment_diff: EnvironmentDiffNamespace
5875
6521
  attr_reader expiring: ExpiringNamespace
5876
6522
  attr_reader invitations: InvitationsNamespace
6523
+ attr_reader invoices: InvoicesNamespace
5877
6524
  attr_reader jira: JiraNamespace
5878
6525
  attr_reader kv: KvNamespace
5879
6526
  attr_reader leases: LeasesNamespace
5880
6527
  attr_reader linear: LinearNamespace
5881
6528
  attr_reader log_workspaces: LogWorkspacesNamespace
6529
+ attr_reader managed_accounts: ManagedAccountsNamespace
5882
6530
  attr_reader metric_alerts: MetricAlertsNamespace
5883
6531
  attr_reader moment: MomentNamespace
5884
6532
  attr_reader msteams: MsteamsNamespace