infrawrench-sdk 1.81.0 → 1.82.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,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # infrawrench-sdk v1.81.0 | MIT | Copyright (c) 2026 Infrawrench LLC
3
+ # infrawrench-sdk v1.82.0 | MIT | Copyright (c) 2026 Infrawrench LLC
4
4
  # https://github.com/Infrawrench/Infrawrench
5
5
  #
6
- # Generated from the Infrawrench API OpenAPI 3.1 spec (API version 1.81.0).
6
+ # Generated from the Infrawrench API OpenAPI 3.1 spec (API version 1.82.0).
7
7
  #
8
8
  # DO NOT EDIT. Regenerate with:
9
9
  # pnpm --filter @infrawrench/web generate:sdk
@@ -2914,6 +2914,147 @@ module Infrawrench
2914
2914
  end
2915
2915
  end
2916
2916
 
2917
+ # `client.billing_profiles`
2918
+ class BillingProfilesNamespace
2919
+ # @api private
2920
+ # @param transport [Transport]
2921
+ def initialize(transport)
2922
+ @transport = transport
2923
+ end
2924
+
2925
+ # Create a billing profile
2926
+ #
2927
+ # _Requires permission: `invoices:write`._
2928
+ #
2929
+ # POST /api/org/{orgId}/billing-profiles
2930
+ #
2931
+ # Raises on 400: Bad request
2932
+ #
2933
+ # Raises on 409: Conflict
2934
+ #
2935
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
2936
+ # constructed with.
2937
+ # @param body [Hash] Request body, shaped as `BillingProfileInput`.
2938
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
2939
+ # @return [Hash] Parsed JSON, shaped as `BillingProfile` — see `sig/infrawrench/sdk.rbs`.
2940
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
2941
+ def create(body:, org_id: nil, request_options: nil)
2942
+ @transport.request(
2943
+ http_method: "POST",
2944
+ path: "/api/org/{orgId}/billing-profiles",
2945
+ path_params: { "orgId" => org_id },
2946
+ body: body,
2947
+ request_options: request_options
2948
+ )
2949
+ end
2950
+
2951
+ # Delete a billing profile
2952
+ #
2953
+ # Refused with 409, naming them, while live customers are assigned: removing
2954
+ # a profile out from under a customer would change the address, tax and
2955
+ # numbering of its next invoice.
2956
+ #
2957
+ # _Requires permission: `invoices:write`._
2958
+ #
2959
+ # DELETE /api/org/{orgId}/billing-profiles/{id}
2960
+ #
2961
+ # Raises on 404: Not found
2962
+ #
2963
+ # Raises on 409: Conflict
2964
+ #
2965
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
2966
+ # constructed with.
2967
+ # @param id [String]
2968
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
2969
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
2970
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
2971
+ def delete(id:, org_id: nil, request_options: nil)
2972
+ @transport.request(
2973
+ http_method: "DELETE",
2974
+ path: "/api/org/{orgId}/billing-profiles/{id}",
2975
+ path_params: { "orgId" => org_id, "id" => id },
2976
+ request_options: request_options
2977
+ )
2978
+ end
2979
+
2980
+ # Get a billing profile
2981
+ #
2982
+ # _Requires permission: `invoices:read`._
2983
+ #
2984
+ # GET /api/org/{orgId}/billing-profiles/{id}
2985
+ #
2986
+ # Raises on 404: Not found
2987
+ #
2988
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
2989
+ # constructed with.
2990
+ # @param id [String]
2991
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
2992
+ # @return [Hash] Parsed JSON, shaped as `BillingProfile` — see `sig/infrawrench/sdk.rbs`.
2993
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
2994
+ def get(id:, org_id: nil, request_options: nil)
2995
+ @transport.request(
2996
+ http_method: "GET",
2997
+ path: "/api/org/{orgId}/billing-profiles/{id}",
2998
+ path_params: { "orgId" => org_id, "id" => id },
2999
+ request_options: request_options
3000
+ )
3001
+ end
3002
+
3003
+ # List billing profiles
3004
+ #
3005
+ # _Requires permission: `invoices:read`._
3006
+ #
3007
+ # GET /api/org/{orgId}/billing-profiles
3008
+ #
3009
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
3010
+ # constructed with.
3011
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
3012
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<BillingProfile>` — see
3013
+ # `sig/infrawrench/sdk.rbs`.
3014
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
3015
+ def list(org_id: nil, request_options: nil)
3016
+ @transport.request(
3017
+ http_method: "GET",
3018
+ path: "/api/org/{orgId}/billing-profiles",
3019
+ path_params: { "orgId" => org_id },
3020
+ request_options: request_options
3021
+ )
3022
+ end
3023
+
3024
+ # Update a billing profile
3025
+ #
3026
+ # A full replace, except `logo`, which is left as saved when absent. Draft
3027
+ # invoices of the assigned customers follow the change; approved invoices
3028
+ # keep the copy frozen onto them.
3029
+ #
3030
+ # _Requires permission: `invoices:write`._
3031
+ #
3032
+ # PUT /api/org/{orgId}/billing-profiles/{id}
3033
+ #
3034
+ # Raises on 400: Bad request
3035
+ #
3036
+ # Raises on 404: Not found
3037
+ #
3038
+ # Raises on 409: Conflict
3039
+ #
3040
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
3041
+ # constructed with.
3042
+ # @param id [String]
3043
+ # @param body [Hash] Request body, shaped as `BillingProfileInput`.
3044
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
3045
+ # @return [Hash] Parsed JSON, shaped as `BillingProfile` — see `sig/infrawrench/sdk.rbs`.
3046
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
3047
+ def update(id:, body:, org_id: nil, request_options: nil)
3048
+ @transport.request(
3049
+ http_method: "PUT",
3050
+ path: "/api/org/{orgId}/billing-profiles/{id}",
3051
+ path_params: { "orgId" => org_id, "id" => id },
3052
+ body: body,
3053
+ request_options: request_options
3054
+ )
3055
+ end
3056
+ end
3057
+
2917
3058
  # `client.billing_rules`
2918
3059
  class BillingRulesNamespace
2919
3060
  # @api private
@@ -3361,6 +3502,106 @@ module Infrawrench
3361
3502
  end
3362
3503
  end
3363
3504
 
3505
+ # `client.business_metrics.forecast_values`
3506
+ class BusinessMetricsForecastValuesNamespace
3507
+ # @api private
3508
+ # @param transport [Transport]
3509
+ def initialize(transport)
3510
+ @transport = transport
3511
+ end
3512
+
3513
+ # Write forecasted metric values
3514
+ #
3515
+ # Re-sending a day restates it. Values must be non-negative.
3516
+ #
3517
+ # _Requires permission: `costs:write`._
3518
+ #
3519
+ # POST /api/org/{orgId}/business-metrics/{id}/forecast-values
3520
+ #
3521
+ # Raises on 400: Bad request
3522
+ #
3523
+ # Raises on 404: Not found
3524
+ #
3525
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
3526
+ # constructed with.
3527
+ # @param id [String] Metric id or key
3528
+ # @param body [Hash] Request body, shaped as `BusinessMetricForecastValuesInput`.
3529
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
3530
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
3531
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
3532
+ def create(id:, body:, org_id: nil, request_options: nil)
3533
+ @transport.request(
3534
+ http_method: "POST",
3535
+ path: "/api/org/{orgId}/business-metrics/{id}/forecast-values",
3536
+ path_params: { "orgId" => org_id, "id" => id },
3537
+ body: body,
3538
+ request_options: request_options
3539
+ )
3540
+ end
3541
+
3542
+ # Delete forecasted metric values
3543
+ #
3544
+ # Removes planned days in `[from, to]`; omit both to clear every planned
3545
+ # day.
3546
+ #
3547
+ # _Requires permission: `costs:write`._
3548
+ #
3549
+ # DELETE /api/org/{orgId}/business-metrics/{id}/forecast-values
3550
+ #
3551
+ # Raises on 400: Bad request
3552
+ #
3553
+ # Raises on 404: Not found
3554
+ #
3555
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
3556
+ # constructed with.
3557
+ # @param id [String] Metric id or key
3558
+ # @param from [String, nil]
3559
+ # @param to [String, nil]
3560
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
3561
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
3562
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
3563
+ def delete(id:, org_id: nil, from: nil, to: nil, request_options: nil)
3564
+ @transport.request(
3565
+ http_method: "DELETE",
3566
+ path: "/api/org/{orgId}/business-metrics/{id}/forecast-values",
3567
+ path_params: { "orgId" => org_id, "id" => id },
3568
+ query: { "from" => from, "to" => to },
3569
+ request_options: request_options
3570
+ )
3571
+ end
3572
+
3573
+ # List a metric's forecasted values
3574
+ #
3575
+ # Planned values, kept apart from the reported actuals: no unit cost,
3576
+ # threshold or coverage figure ever reads them. Day order.
3577
+ #
3578
+ # _Requires permission: `costs:read`._
3579
+ #
3580
+ # GET /api/org/{orgId}/business-metrics/{id}/forecast-values
3581
+ #
3582
+ # Raises on 400: Bad request
3583
+ #
3584
+ # Raises on 404: Not found
3585
+ #
3586
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
3587
+ # constructed with.
3588
+ # @param id [String] Metric id or key
3589
+ # @param from [String, nil]
3590
+ # @param to [String, nil]
3591
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
3592
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
3593
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
3594
+ def get(id:, org_id: nil, from: nil, to: nil, request_options: nil)
3595
+ @transport.request(
3596
+ http_method: "GET",
3597
+ path: "/api/org/{orgId}/business-metrics/{id}/forecast-values",
3598
+ path_params: { "orgId" => org_id, "id" => id },
3599
+ query: { "from" => from, "to" => to },
3600
+ request_options: request_options
3601
+ )
3602
+ end
3603
+ end
3604
+
3364
3605
  # `client.business_metrics.get`
3365
3606
  class BusinessMetricsGetNamespace
3366
3607
  # @api private
@@ -3572,26 +3813,37 @@ module Infrawrench
3572
3813
  end
3573
3814
  end
3574
3815
 
3575
- # `client.business_metrics.values`
3576
- class BusinessMetricsValuesNamespace
3816
+ # `client.business_metrics.unit_costs`
3817
+ class BusinessMetricsUnitCostsNamespace
3577
3818
  # @api private
3578
3819
  # @param transport [Transport]
3579
3820
  def initialize(transport)
3580
3821
  @transport = transport
3581
3822
  end
3582
3823
 
3583
- # Report metric values
3824
+ # Query unit costs or margin
3584
3825
  #
3585
- # Write a batch of days. **Re-reporting a day restates it rather than
3586
- # accumulating**, which is what makes a nightly job safe to retry. Nothing
3587
- # lands unless the whole batch validates, so a bad row is a 400 rather than
3588
- # half a month restated. The same guarantees back
3589
- # `infra.businessMetrics.write(...)` in a workflow; both go through one
3590
- # validator.
3826
+ # Divide spend by the metric, bucketed as asked. Three properties of the
3827
+ # answer are worth knowing before reading it:
3591
3828
  #
3592
- # _Requires permission: `costs:write`._
3829
+ # - **The ratio is computed at the requested bucket**, from a summed
3830
+ # numerator and a summed denominator: never a mean of daily ratios, which
3831
+ # weights a quiet day as heavily as a peak one. The same holds for
3832
+ # `overallValue`.
3833
+ # - **A missing or non-positive denominator is a gap** (`value: null` with a
3834
+ # `gap` reason), never 0 and never infinite.
3835
+ # - **Currencies are never merged.** Spend in a currency with no stated rate
3836
+ # keeps its own series rather than being dropped or added to another.
3593
3837
  #
3594
- # POST /api/org/{orgId}/business-metrics/{id}/values
3838
+ # There is no spend `groupBy`: a per-group ratio needs a per-group
3839
+ # denominator. Split by a metric label with `groupByLabel` instead; in a
3840
+ # ratio mode the label must be mapped to the cost dimension its values name
3841
+ # (`labelMappings` on the metric), so each label value's spend is divided by
3842
+ # its own volume.
3843
+ #
3844
+ # _Requires permission: `costs:read`._
3845
+ #
3846
+ # POST /api/org/{orgId}/business-metrics/{id}/unit-costs
3595
3847
  #
3596
3848
  # Raises on 400: Bad request
3597
3849
  #
@@ -3600,27 +3852,38 @@ module Infrawrench
3600
3852
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
3601
3853
  # constructed with.
3602
3854
  # @param id [String] Metric id or key
3603
- # @param body [Hash] Request body, shaped as `BusinessMetricValuesInput`.
3855
+ # @param body [Hash] Request body, shaped as `UnitCostQueryRequest`.
3604
3856
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
3605
- # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
3857
+ # @return [Hash] Parsed JSON, shaped as `UnitCostQueryResponse` — see
3858
+ # `sig/infrawrench/sdk.rbs`.
3606
3859
  # @raise [Infrawrench::ApiError] On any non-2xx response.
3607
3860
  def create(id:, body:, org_id: nil, request_options: nil)
3608
3861
  @transport.request(
3609
3862
  http_method: "POST",
3610
- path: "/api/org/{orgId}/business-metrics/{id}/values",
3863
+ path: "/api/org/{orgId}/business-metrics/{id}/unit-costs",
3611
3864
  path_params: { "orgId" => org_id, "id" => id },
3612
3865
  body: body,
3613
3866
  request_options: request_options
3614
3867
  )
3615
3868
  end
3616
3869
 
3617
- # List a metric's reported values
3870
+ # Export unit costs or margin as a file
3618
3871
  #
3619
- # Newest day first.
3872
+ # The query `POST /business-metrics/{id}/unit-costs` answers, as CSV or
3873
+ # NDJSON. One row per bucket per series (and per label value when grouped),
3874
+ # columns in this order: `bucket`, `bucket_days`, `reported_days`,
3875
+ # `partial`, `label_key`, `label_value`, `label_other`, `currency`, `mode`,
3876
+ # `scale`, `metric_key`, `metric_unit`, `usage_unit`, `cost` (summed spend),
3877
+ # `metric_value` (summed denominator, unscaled), `value` (the ratio, already
3878
+ # scaled), `absolute_margin`, `gap`. A gap is an **empty** `value` with its
3879
+ # reason in `gap`, never 0, and `partial` flags a bucket whose denominator
3880
+ # covers only some of its days. Text cells starting with `=`, `+`, `-` or
3881
+ # `@` are prefixed with `'` so a spreadsheet does not run them. NDJSON
3882
+ # carries the same keys, with `null` for empty.
3620
3883
  #
3621
3884
  # _Requires permission: `costs:read`._
3622
3885
  #
3623
- # GET /api/org/{orgId}/business-metrics/{id}/values
3886
+ # POST /api/org/{orgId}/business-metrics/{id}/unit-costs/export
3624
3887
  #
3625
3888
  # Raises on 400: Bad request
3626
3889
  #
@@ -3629,40 +3892,195 @@ module Infrawrench
3629
3892
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
3630
3893
  # constructed with.
3631
3894
  # @param id [String] Metric id or key
3632
- # @param limit [Integer, nil] Default 90.
3895
+ # @param body [Hash] Request body, shaped as `UnitCostExportRequest`.
3633
3896
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
3634
- # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
3897
+ # @return [String] Parsed JSON, shaped as `String` — see `sig/infrawrench/sdk.rbs`.
3635
3898
  # @raise [Infrawrench::ApiError] On any non-2xx response.
3636
- def get(id:, org_id: nil, limit: nil, request_options: nil)
3899
+ def export(id:, body:, org_id: nil, request_options: nil)
3637
3900
  @transport.request(
3638
- http_method: "GET",
3639
- path: "/api/org/{orgId}/business-metrics/{id}/values",
3901
+ http_method: "POST",
3902
+ path: "/api/org/{orgId}/business-metrics/{id}/unit-costs/export",
3640
3903
  path_params: { "orgId" => org_id, "id" => id },
3641
- query: { "limit" => limit },
3904
+ body: body,
3642
3905
  request_options: request_options
3643
3906
  )
3644
3907
  end
3645
3908
  end
3646
3909
 
3647
- # `client.business_metrics`
3648
- class BusinessMetricsNamespace
3649
- # @return [BusinessMetricsGetNamespace] `client.business_metrics.get`
3650
- attr_reader :get
3651
- # @return [BusinessMetricsImporterNamespace] `client.business_metrics.importer`
3652
- attr_reader :importer
3653
- # @return [BusinessMetricsValuesNamespace] `client.business_metrics.values`
3654
- attr_reader :values
3655
-
3910
+ # `client.business_metrics.usage_unit_costs`
3911
+ class BusinessMetricsUsageUnitCostsNamespace
3656
3912
  # @api private
3657
3913
  # @param transport [Transport]
3658
3914
  def initialize(transport)
3659
3915
  @transport = transport
3660
- @get = BusinessMetricsGetNamespace.new(@transport)
3661
- @importer = BusinessMetricsImporterNamespace.new(@transport)
3662
- @values = BusinessMetricsValuesNamespace.new(@transport)
3663
3916
  end
3664
3917
 
3665
- # Create a business metric
3918
+ # Query cost per usage unit
3919
+ #
3920
+ # Spend divided by the usage quantity providers report in one `usageUnit`,
3921
+ # with no business metric involved. Both halves come from the same cost rows
3922
+ # (those reported in that unit), so the numerator is exactly the spend that
3923
+ # bought the denominator. A bucket with no usage is a gap (`no_usage`),
3924
+ # never 0. Labels do not apply.
3925
+ #
3926
+ # POST /api/org/{orgId}/business-metrics/usage-unit-costs
3927
+ #
3928
+ # Raises on 400: Bad request
3929
+ #
3930
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
3931
+ # constructed with.
3932
+ # @param body [Hash] Request body, shaped as `UnitCostQueryRequest`.
3933
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
3934
+ # @return [Hash] Parsed JSON, shaped as `UnitCostQueryResponse` — see
3935
+ # `sig/infrawrench/sdk.rbs`.
3936
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
3937
+ def create(body:, org_id: nil, request_options: nil)
3938
+ @transport.request(
3939
+ http_method: "POST",
3940
+ path: "/api/org/{orgId}/business-metrics/usage-unit-costs",
3941
+ path_params: { "orgId" => org_id },
3942
+ body: body,
3943
+ request_options: request_options
3944
+ )
3945
+ end
3946
+
3947
+ # Export cost per usage unit as a file
3948
+ #
3949
+ # The query `POST /business-metrics/usage-unit-costs` answers, as CSV or
3950
+ # NDJSON. One row per bucket per series (and per label value when grouped),
3951
+ # columns in this order: `bucket`, `bucket_days`, `reported_days`,
3952
+ # `partial`, `label_key`, `label_value`, `label_other`, `currency`, `mode`,
3953
+ # `scale`, `metric_key`, `metric_unit`, `usage_unit`, `cost` (summed spend),
3954
+ # `metric_value` (summed denominator, unscaled), `value` (the ratio, already
3955
+ # scaled), `absolute_margin`, `gap`. A gap is an **empty** `value` with its
3956
+ # reason in `gap`, never 0, and `partial` flags a bucket whose denominator
3957
+ # covers only some of its days. Text cells starting with `=`, `+`, `-` or
3958
+ # `@` are prefixed with `'` so a spreadsheet does not run them. NDJSON
3959
+ # carries the same keys, with `null` for empty.
3960
+ #
3961
+ # _Requires permission: `costs:read`._
3962
+ #
3963
+ # POST /api/org/{orgId}/business-metrics/usage-unit-costs/export
3964
+ #
3965
+ # Raises on 400: Bad request
3966
+ #
3967
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
3968
+ # constructed with.
3969
+ # @param body [Hash] Request body, shaped as `UnitCostExportRequest`.
3970
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
3971
+ # @return [String] Parsed JSON, shaped as `String` — see `sig/infrawrench/sdk.rbs`.
3972
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
3973
+ def export(body:, org_id: nil, request_options: nil)
3974
+ @transport.request(
3975
+ http_method: "POST",
3976
+ path: "/api/org/{orgId}/business-metrics/usage-unit-costs/export",
3977
+ path_params: { "orgId" => org_id },
3978
+ body: body,
3979
+ request_options: request_options
3980
+ )
3981
+ end
3982
+ end
3983
+
3984
+ # `client.business_metrics.values`
3985
+ class BusinessMetricsValuesNamespace
3986
+ # @api private
3987
+ # @param transport [Transport]
3988
+ def initialize(transport)
3989
+ @transport = transport
3990
+ end
3991
+
3992
+ # Report metric values
3993
+ #
3994
+ # Write a batch of days. **Re-reporting a day restates it rather than
3995
+ # accumulating**, which is what makes a nightly job safe to retry. Nothing
3996
+ # lands unless the whole batch validates, so a bad row is a 400 rather than
3997
+ # half a month restated. The same guarantees back
3998
+ # `infra.businessMetrics.write(...)` in a workflow; both go through one
3999
+ # validator.
4000
+ #
4001
+ # _Requires permission: `costs:write`._
4002
+ #
4003
+ # POST /api/org/{orgId}/business-metrics/{id}/values
4004
+ #
4005
+ # Raises on 400: Bad request
4006
+ #
4007
+ # Raises on 404: Not found
4008
+ #
4009
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
4010
+ # constructed with.
4011
+ # @param id [String] Metric id or key
4012
+ # @param body [Hash] Request body, shaped as `BusinessMetricValuesInput`.
4013
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
4014
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
4015
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
4016
+ def create(id:, body:, org_id: nil, request_options: nil)
4017
+ @transport.request(
4018
+ http_method: "POST",
4019
+ path: "/api/org/{orgId}/business-metrics/{id}/values",
4020
+ path_params: { "orgId" => org_id, "id" => id },
4021
+ body: body,
4022
+ request_options: request_options
4023
+ )
4024
+ end
4025
+
4026
+ # List a metric's reported values
4027
+ #
4028
+ # Newest day first.
4029
+ #
4030
+ # _Requires permission: `costs:read`._
4031
+ #
4032
+ # GET /api/org/{orgId}/business-metrics/{id}/values
4033
+ #
4034
+ # Raises on 400: Bad request
4035
+ #
4036
+ # Raises on 404: Not found
4037
+ #
4038
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
4039
+ # constructed with.
4040
+ # @param id [String] Metric id or key
4041
+ # @param limit [Integer, nil] Default 90.
4042
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
4043
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
4044
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
4045
+ def get(id:, org_id: nil, limit: nil, request_options: nil)
4046
+ @transport.request(
4047
+ http_method: "GET",
4048
+ path: "/api/org/{orgId}/business-metrics/{id}/values",
4049
+ path_params: { "orgId" => org_id, "id" => id },
4050
+ query: { "limit" => limit },
4051
+ request_options: request_options
4052
+ )
4053
+ end
4054
+ end
4055
+
4056
+ # `client.business_metrics`
4057
+ class BusinessMetricsNamespace
4058
+ # @return [BusinessMetricsForecastValuesNamespace] `client.business_metrics.forecast_values`
4059
+ attr_reader :forecast_values
4060
+ # @return [BusinessMetricsGetNamespace] `client.business_metrics.get`
4061
+ attr_reader :get
4062
+ # @return [BusinessMetricsImporterNamespace] `client.business_metrics.importer`
4063
+ attr_reader :importer
4064
+ # @return [BusinessMetricsUnitCostsNamespace] `client.business_metrics.unit_costs`
4065
+ attr_reader :unit_costs
4066
+ # @return [BusinessMetricsUsageUnitCostsNamespace] `client.business_metrics.usage_unit_costs`
4067
+ attr_reader :usage_unit_costs
4068
+ # @return [BusinessMetricsValuesNamespace] `client.business_metrics.values`
4069
+ attr_reader :values
4070
+
4071
+ # @api private
4072
+ # @param transport [Transport]
4073
+ def initialize(transport)
4074
+ @transport = transport
4075
+ @forecast_values = BusinessMetricsForecastValuesNamespace.new(@transport)
4076
+ @get = BusinessMetricsGetNamespace.new(@transport)
4077
+ @importer = BusinessMetricsImporterNamespace.new(@transport)
4078
+ @unit_costs = BusinessMetricsUnitCostsNamespace.new(@transport)
4079
+ @usage_unit_costs = BusinessMetricsUsageUnitCostsNamespace.new(@transport)
4080
+ @values = BusinessMetricsValuesNamespace.new(@transport)
4081
+ end
4082
+
4083
+ # Create a business metric
3666
4084
  #
3667
4085
  # Keys must be unique per organization among live metrics; they are how
3668
4086
  # workflows and the CLI address the metric. A key collision is a 409.
@@ -3830,52 +4248,6 @@ module Infrawrench
3830
4248
  )
3831
4249
  end
3832
4250
 
3833
- # Query unit costs or margin
3834
- #
3835
- # Divide spend by the metric, bucketed as asked. Three properties of the
3836
- # answer are worth knowing before reading it:
3837
- #
3838
- # - **The ratio is computed at the requested bucket**, from a summed
3839
- # numerator and a summed denominator: never a mean of daily ratios, which
3840
- # weights a quiet day as heavily as a peak one. The same holds for
3841
- # `overallValue`.
3842
- # - **A missing or non-positive denominator is a gap** (`value: null` with a
3843
- # `gap` reason), never 0 and never infinite.
3844
- # - **Currencies are never merged.** Spend in a currency with no stated rate
3845
- # keeps its own series rather than being dropped or added to another.
3846
- #
3847
- # There is no spend `groupBy`: a per-group ratio needs a per-group
3848
- # denominator. Split by a metric label with `groupByLabel` instead; in a
3849
- # ratio mode the label must be mapped to the cost dimension its values name
3850
- # (`labelMappings` on the metric), so each label value's spend is divided by
3851
- # its own volume.
3852
- #
3853
- # _Requires permission: `costs:read`._
3854
- #
3855
- # POST /api/org/{orgId}/business-metrics/{id}/unit-costs
3856
- #
3857
- # Raises on 400: Bad request
3858
- #
3859
- # Raises on 404: Not found
3860
- #
3861
- # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
3862
- # constructed with.
3863
- # @param id [String] Metric id or key
3864
- # @param body [Hash] Request body, shaped as `UnitCostQueryRequest`.
3865
- # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
3866
- # @return [Hash] Parsed JSON, shaped as `UnitCostQueryResponse` — see
3867
- # `sig/infrawrench/sdk.rbs`.
3868
- # @raise [Infrawrench::ApiError] On any non-2xx response.
3869
- def unit_costs(id:, body:, org_id: nil, request_options: nil)
3870
- @transport.request(
3871
- http_method: "POST",
3872
- path: "/api/org/{orgId}/business-metrics/{id}/unit-costs",
3873
- path_params: { "orgId" => org_id, "id" => id },
3874
- body: body,
3875
- request_options: request_options
3876
- )
3877
- end
3878
-
3879
4251
  # Update a business metric
3880
4252
  #
3881
4253
  # Replaces the whole definition. Changing `key` never orphans history
@@ -3910,35 +4282,6 @@ module Infrawrench
3910
4282
  )
3911
4283
  end
3912
4284
 
3913
- # Query cost per usage unit
3914
- #
3915
- # Spend divided by the usage quantity providers report in one `usageUnit`,
3916
- # with no business metric involved. Both halves come from the same cost rows
3917
- # (those reported in that unit), so the numerator is exactly the spend that
3918
- # bought the denominator. A bucket with no usage is a gap (`no_usage`),
3919
- # never 0. Labels do not apply.
3920
- #
3921
- # POST /api/org/{orgId}/business-metrics/usage-unit-costs
3922
- #
3923
- # Raises on 400: Bad request
3924
- #
3925
- # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
3926
- # constructed with.
3927
- # @param body [Hash] Request body, shaped as `UnitCostQueryRequest`.
3928
- # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
3929
- # @return [Hash] Parsed JSON, shaped as `UnitCostQueryResponse` — see
3930
- # `sig/infrawrench/sdk.rbs`.
3931
- # @raise [Infrawrench::ApiError] On any non-2xx response.
3932
- def usage_unit_costs(body:, org_id: nil, request_options: nil)
3933
- @transport.request(
3934
- http_method: "POST",
3935
- path: "/api/org/{orgId}/business-metrics/usage-unit-costs",
3936
- path_params: { "orgId" => org_id },
3937
- body: body,
3938
- request_options: request_options
3939
- )
3940
- end
3941
-
3942
4285
  # List usage units
3943
4286
  #
3944
4287
  # The provider usage units the organization's cost rows carry over the last
@@ -5351,7 +5694,7 @@ module Infrawrench
5351
5694
  # constructed with.
5352
5695
  # @param sections [String, nil] Comma-separated subset of sections to export. Defaults to
5353
5696
  # all of: budgets, customGraphs, workflows, dashboards, metricAlerts, probes, slos,
5354
- # costCentres, tagPolicy, alertSettings.
5697
+ # costCentres, tagPolicy, alertSettings, savingsViews.
5355
5698
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
5356
5699
  # @return [Hash] Parsed JSON, shaped as `OrgConfigDocument` — see `sig/infrawrench/sdk.rbs`.
5357
5700
  # @raise [Infrawrench::ApiError] On any non-2xx response.
@@ -6752,6 +7095,38 @@ module Infrawrench
6752
7095
  end
6753
7096
  end
6754
7097
 
7098
+ # `client.cost_report_anomaly_alerts`
7099
+ class CostReportAnomalyAlertsNamespace
7100
+ # @api private
7101
+ # @param transport [Transport]
7102
+ def initialize(transport)
7103
+ @transport = transport
7104
+ end
7105
+
7106
+ # List report anomaly alerts
7107
+ #
7108
+ # Every report anomaly alert in the organization whose report the caller can
7109
+ # see, in report name order, each with its latest findings.
7110
+ #
7111
+ # _Requires permission: `costs:read`._
7112
+ #
7113
+ # GET /api/org/{orgId}/cost-report-anomaly-alerts
7114
+ #
7115
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
7116
+ # constructed with.
7117
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
7118
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
7119
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
7120
+ def get(org_id: nil, request_options: nil)
7121
+ @transport.request(
7122
+ http_method: "GET",
7123
+ path: "/api/org/{orgId}/cost-report-anomaly-alerts",
7124
+ path_params: { "orgId" => org_id },
7125
+ request_options: request_options
7126
+ )
7127
+ end
7128
+ end
7129
+
6755
7130
  # `client.cost_report_folders`
6756
7131
  class CostReportFoldersNamespace
6757
7132
  # @api private
@@ -6905,42 +7280,295 @@ module Infrawrench
6905
7280
  end
6906
7281
  end
6907
7282
 
6908
- # `client.cost_reports.notifications`
6909
- class CostReportsNotificationsNamespace
7283
+ # `client.cost_reports.anomaly_alert`
7284
+ class CostReportsAnomalyAlertNamespace
6910
7285
  # @api private
6911
7286
  # @param transport [Transport]
6912
7287
  def initialize(transport)
6913
7288
  @transport = transport
6914
7289
  end
6915
7290
 
6916
- # Create a delivery schedule
7291
+ # Delete a report's anomaly alert
6917
7292
  #
6918
- # On its cadence the server runs the report and sends a composed text
6919
- # summary; period total (converted to the org's display currency where
6920
- # configured, with the conversion caveat), change vs the previous period,
6921
- # top groups, and a deep link. No chart images. An empty result still sends,
6922
- # saying so.
7293
+ # Removes the alert and its findings. The report itself is untouched.
6923
7294
  #
6924
7295
  # _Requires permission: `org:settings:write`._
6925
7296
  #
6926
- # POST /api/org/{orgId}/cost-reports/{id}/notifications
6927
- #
6928
- # Raises on 400: Bad request
7297
+ # DELETE /api/org/{orgId}/cost-reports/{id}/anomaly-alert
6929
7298
  #
6930
7299
  # Raises on 404: Not found
6931
7300
  #
6932
7301
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
6933
7302
  # constructed with.
6934
7303
  # @param id [String]
6935
- # @param body [Hash] Request body, shaped as `ReportNotificationInput`.
6936
7304
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
6937
- # @return [Hash] Parsed JSON, shaped as `ReportNotification` — see
6938
- # `sig/infrawrench/sdk.rbs`.
7305
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
6939
7306
  # @raise [Infrawrench::ApiError] On any non-2xx response.
6940
- def create(id:, body:, org_id: nil, request_options: nil)
7307
+ def delete(id:, org_id: nil, request_options: nil)
6941
7308
  @transport.request(
6942
- http_method: "POST",
6943
- path: "/api/org/{orgId}/cost-reports/{id}/notifications",
7309
+ http_method: "DELETE",
7310
+ path: "/api/org/{orgId}/cost-reports/{id}/anomaly-alert",
7311
+ path_params: { "orgId" => org_id, "id" => id },
7312
+ request_options: request_options
7313
+ )
7314
+ end
7315
+
7316
+ # Get a report's anomaly alert
7317
+ #
7318
+ # The report's own anomaly alert and its latest findings. The detector
7319
+ # judges the report's filtered daily total (its filters and saved filter,
7320
+ # per currency) against the trailing 28 days after each cost collection,
7321
+ # re-judging the last three days as they fill in, and delivers a day once
7322
+ # (then a 7-day cooldown per currency). 404 when the report has none, or
7323
+ # when the caller cannot see the report.
7324
+ #
7325
+ # _Requires permission: `costs:read`._
7326
+ #
7327
+ # GET /api/org/{orgId}/cost-reports/{id}/anomaly-alert
7328
+ #
7329
+ # Raises on 404: Not found
7330
+ #
7331
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
7332
+ # constructed with.
7333
+ # @param id [String]
7334
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
7335
+ # @return [Hash] Parsed JSON, shaped as `CostReportAnomalyAlert` — see
7336
+ # `sig/infrawrench/sdk.rbs`.
7337
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
7338
+ def get(id:, org_id: nil, request_options: nil)
7339
+ @transport.request(
7340
+ http_method: "GET",
7341
+ path: "/api/org/{orgId}/cost-reports/{id}/anomaly-alert",
7342
+ path_params: { "orgId" => org_id, "id" => id },
7343
+ request_options: request_options
7344
+ )
7345
+ end
7346
+
7347
+ # List destinations for a report anomaly alert
7348
+ #
7349
+ # The organization's connected Slack channels, Teams webhooks, live on-call
7350
+ # rotations, members and external-address policy: what the destination
7351
+ # picker offers. Paging provider targets are listed by `GET
7352
+ # /paging-providers/destinations`.
7353
+ #
7354
+ # _Requires permission: `org:settings:write`._
7355
+ #
7356
+ # GET /api/org/{orgId}/cost-reports/{id}/anomaly-alert/targets
7357
+ #
7358
+ # Raises on 404: Not found
7359
+ #
7360
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
7361
+ # constructed with.
7362
+ # @param id [String]
7363
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
7364
+ # @return [Hash] Parsed JSON, shaped as `CostReportAnomalyAlertTargets` — see
7365
+ # `sig/infrawrench/sdk.rbs`.
7366
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
7367
+ def targets(id:, org_id: nil, request_options: nil)
7368
+ @transport.request(
7369
+ http_method: "GET",
7370
+ path: "/api/org/{orgId}/cost-reports/{id}/anomaly-alert/targets",
7371
+ path_params: { "orgId" => org_id, "id" => id },
7372
+ request_options: request_options
7373
+ )
7374
+ end
7375
+
7376
+ # Create or replace a report's anomaly alert
7377
+ #
7378
+ # One alert per report, replaced whole. Destinations must belong to this
7379
+ # organization (a live Slack channel, a Teams webhook, a current member, an
7380
+ # address the email policy allows). Requires `org:settings:write`, like
7381
+ # report delivery schedules. The alert reads spend with the writer's cost
7382
+ # visibility when they are cost-scoped.
7383
+ #
7384
+ # _Requires permission: `org:settings:write`._
7385
+ #
7386
+ # PUT /api/org/{orgId}/cost-reports/{id}/anomaly-alert
7387
+ #
7388
+ # Raises on 400: Bad request
7389
+ #
7390
+ # Raises on 404: Not found
7391
+ #
7392
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
7393
+ # constructed with.
7394
+ # @param id [String]
7395
+ # @param body [Hash] Request body, shaped as `CostReportAnomalyAlertInput`.
7396
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
7397
+ # @return [Hash] Parsed JSON, shaped as `CostReportAnomalyAlert` — see
7398
+ # `sig/infrawrench/sdk.rbs`.
7399
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
7400
+ def update(id:, body:, org_id: nil, request_options: nil)
7401
+ @transport.request(
7402
+ http_method: "PUT",
7403
+ path: "/api/org/{orgId}/cost-reports/{id}/anomaly-alert",
7404
+ path_params: { "orgId" => org_id, "id" => id },
7405
+ body: body,
7406
+ request_options: request_options
7407
+ )
7408
+ end
7409
+ end
7410
+
7411
+ # `client.cost_reports.forecasts`
7412
+ class CostReportsForecastsNamespace
7413
+ # @api private
7414
+ # @param transport [Transport]
7415
+ def initialize(transport)
7416
+ @transport = transport
7417
+ end
7418
+
7419
+ # Add a named forecast to a report
7420
+ #
7421
+ # A forecast combines a baseline (the trend, or a driver metric's forecasted
7422
+ # values times the projected unit cost) with scenario models in priority
7423
+ # order. Needs editor access to the report.
7424
+ #
7425
+ # _Requires permission: `costs:write`._
7426
+ #
7427
+ # POST /api/org/{orgId}/cost-reports/{id}/forecasts
7428
+ #
7429
+ # Raises on 400: Bad request
7430
+ #
7431
+ # Raises on 403: Forbidden
7432
+ #
7433
+ # Raises on 404: Not found
7434
+ #
7435
+ # Raises on 409: Conflict
7436
+ #
7437
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
7438
+ # constructed with.
7439
+ # @param id [String]
7440
+ # @param body [Hash] Request body, shaped as `CostForecastInput`.
7441
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
7442
+ # @return [Hash] Parsed JSON, shaped as `CostForecast` — see `sig/infrawrench/sdk.rbs`.
7443
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
7444
+ def create(id:, body:, org_id: nil, request_options: nil)
7445
+ @transport.request(
7446
+ http_method: "POST",
7447
+ path: "/api/org/{orgId}/cost-reports/{id}/forecasts",
7448
+ path_params: { "orgId" => org_id, "id" => id },
7449
+ body: body,
7450
+ request_options: request_options
7451
+ )
7452
+ end
7453
+
7454
+ # Delete a named forecast
7455
+ #
7456
+ # _Requires permission: `costs:write`._
7457
+ #
7458
+ # DELETE /api/org/{orgId}/cost-reports/{id}/forecasts/{forecastId}
7459
+ #
7460
+ # Raises on 403: Forbidden
7461
+ #
7462
+ # Raises on 404: Not found
7463
+ #
7464
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
7465
+ # constructed with.
7466
+ # @param id [String]
7467
+ # @param forecast_id [String]
7468
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
7469
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
7470
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
7471
+ def delete(id:, forecast_id:, org_id: nil, request_options: nil)
7472
+ @transport.request(
7473
+ http_method: "DELETE",
7474
+ path: "/api/org/{orgId}/cost-reports/{id}/forecasts/{forecastId}",
7475
+ path_params: { "orgId" => org_id, "id" => id, "forecastId" => forecast_id },
7476
+ request_options: request_options
7477
+ )
7478
+ end
7479
+
7480
+ # List a report's named forecasts
7481
+ #
7482
+ # _Requires permission: `costs:read`._
7483
+ #
7484
+ # GET /api/org/{orgId}/cost-reports/{id}/forecasts
7485
+ #
7486
+ # Raises on 404: Not found
7487
+ #
7488
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
7489
+ # constructed with.
7490
+ # @param id [String]
7491
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
7492
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
7493
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
7494
+ def get(id:, org_id: nil, request_options: nil)
7495
+ @transport.request(
7496
+ http_method: "GET",
7497
+ path: "/api/org/{orgId}/cost-reports/{id}/forecasts",
7498
+ path_params: { "orgId" => org_id, "id" => id },
7499
+ request_options: request_options
7500
+ )
7501
+ end
7502
+
7503
+ # Replace a named forecast
7504
+ #
7505
+ # _Requires permission: `costs:write`._
7506
+ #
7507
+ # PUT /api/org/{orgId}/cost-reports/{id}/forecasts/{forecastId}
7508
+ #
7509
+ # Raises on 400: Bad request
7510
+ #
7511
+ # Raises on 403: Forbidden
7512
+ #
7513
+ # Raises on 404: Not found
7514
+ #
7515
+ # Raises on 409: Conflict
7516
+ #
7517
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
7518
+ # constructed with.
7519
+ # @param id [String]
7520
+ # @param forecast_id [String]
7521
+ # @param body [Hash] Request body, shaped as `CostForecastInput`.
7522
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
7523
+ # @return [Hash] Parsed JSON, shaped as `CostForecast` — see `sig/infrawrench/sdk.rbs`.
7524
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
7525
+ def update(id:, forecast_id:, body:, org_id: nil, request_options: nil)
7526
+ @transport.request(
7527
+ http_method: "PUT",
7528
+ path: "/api/org/{orgId}/cost-reports/{id}/forecasts/{forecastId}",
7529
+ path_params: { "orgId" => org_id, "id" => id, "forecastId" => forecast_id },
7530
+ body: body,
7531
+ request_options: request_options
7532
+ )
7533
+ end
7534
+ end
7535
+
7536
+ # `client.cost_reports.notifications`
7537
+ class CostReportsNotificationsNamespace
7538
+ # @api private
7539
+ # @param transport [Transport]
7540
+ def initialize(transport)
7541
+ @transport = transport
7542
+ end
7543
+
7544
+ # Create a delivery schedule
7545
+ #
7546
+ # On its cadence the server runs the report and sends a composed text
7547
+ # summary; period total (converted to the org's display currency where
7548
+ # configured, with the conversion caveat), change vs the previous period,
7549
+ # top groups, and a deep link. No chart images. An empty result still sends,
7550
+ # saying so.
7551
+ #
7552
+ # _Requires permission: `org:settings:write`._
7553
+ #
7554
+ # POST /api/org/{orgId}/cost-reports/{id}/notifications
7555
+ #
7556
+ # Raises on 400: Bad request
7557
+ #
7558
+ # Raises on 404: Not found
7559
+ #
7560
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
7561
+ # constructed with.
7562
+ # @param id [String]
7563
+ # @param body [Hash] Request body, shaped as `ReportNotificationInput`.
7564
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
7565
+ # @return [Hash] Parsed JSON, shaped as `ReportNotification` — see
7566
+ # `sig/infrawrench/sdk.rbs`.
7567
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
7568
+ def create(id:, body:, org_id: nil, request_options: nil)
7569
+ @transport.request(
7570
+ http_method: "POST",
7571
+ path: "/api/org/{orgId}/cost-reports/{id}/notifications",
6944
7572
  path_params: { "orgId" => org_id, "id" => id },
6945
7573
  body: body,
6946
7574
  request_options: request_options
@@ -7092,6 +7720,10 @@ module Infrawrench
7092
7720
 
7093
7721
  # `client.cost_reports`
7094
7722
  class CostReportsNamespace
7723
+ # @return [CostReportsAnomalyAlertNamespace] `client.cost_reports.anomaly_alert`
7724
+ attr_reader :anomaly_alert
7725
+ # @return [CostReportsForecastsNamespace] `client.cost_reports.forecasts`
7726
+ attr_reader :forecasts
7095
7727
  # @return [CostReportsNotificationsNamespace] `client.cost_reports.notifications`
7096
7728
  attr_reader :notifications
7097
7729
 
@@ -7099,6 +7731,8 @@ module Infrawrench
7099
7731
  # @param transport [Transport]
7100
7732
  def initialize(transport)
7101
7733
  @transport = transport
7734
+ @anomaly_alert = CostReportsAnomalyAlertNamespace.new(@transport)
7735
+ @forecasts = CostReportsForecastsNamespace.new(@transport)
7102
7736
  @notifications = CostReportsNotificationsNamespace.new(@transport)
7103
7737
  end
7104
7738
 
@@ -7189,6 +7823,41 @@ module Infrawrench
7189
7823
  )
7190
7824
  end
7191
7825
 
7826
+ # Forecasted costs for a report
7827
+ #
7828
+ # Projected daily spend for the report's scope (its filters, saved filter,
7829
+ # cost basis, charge types and billing rules), optionally narrowed to
7830
+ # providers or services, with a low/expected/high band. Returns the
7831
+ # automatic forecast and the requested one (the report's default when none
7832
+ # is named); `all: true` adds every named forecast. Respects the caller's
7833
+ # cost visibility scope. A read despite the method.
7834
+ #
7835
+ # _Requires permission: `costs:read`._
7836
+ #
7837
+ # POST /api/org/{orgId}/cost-reports/{id}/forecasted-costs
7838
+ #
7839
+ # Raises on 400: Bad request
7840
+ #
7841
+ # Raises on 404: Not found
7842
+ #
7843
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
7844
+ # constructed with.
7845
+ # @param id [String]
7846
+ # @param body [Hash, nil] Request body, shaped as `CostForecastRunRequest`.
7847
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
7848
+ # @return [Hash] Parsed JSON, shaped as `CostForecastResult` — see
7849
+ # `sig/infrawrench/sdk.rbs`.
7850
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
7851
+ def forecasted_costs(id:, org_id: nil, body: nil, request_options: nil)
7852
+ @transport.request(
7853
+ http_method: "POST",
7854
+ path: "/api/org/{orgId}/cost-reports/{id}/forecasted-costs",
7855
+ path_params: { "orgId" => org_id, "id" => id },
7856
+ body: body,
7857
+ request_options: request_options
7858
+ )
7859
+ end
7860
+
7192
7861
  # Get a cost report
7193
7862
  #
7194
7863
  # _Requires permission: `costs:read`._
@@ -7269,8 +7938,8 @@ module Infrawrench
7269
7938
  # inclusive window a relative preset resolved to. The body is optional: the
7270
7939
  # report *is* the query, so a caller never has to reassemble its config to
7271
7940
  # get the numbers. It may carry one-off display overrides (`measure`,
7272
- # `usageUnit`, `binning`, `cumulative`) that apply to this run only and are
7273
- # never saved; switching a run to `usage` or `count` drops the saved
7941
+ # `usageUnit`, `binning`, `cumulative`, `xAxis`) that apply to this run only
7942
+ # and are never saved; switching a run to `usage` or `count` drops the saved
7274
7943
  # forecast, scenario and billing rules, which only apply to money.
7275
7944
  #
7276
7945
  # _Requires permission: `costs:read`._
@@ -8079,44 +8748,212 @@ module Infrawrench
8079
8748
  end
8080
8749
  end
8081
8750
 
8082
- # `client.costs`
8083
- class CostsNamespace
8084
- # @return [CostsAnomaliesNamespace] `client.costs.anomalies`
8085
- attr_reader :anomalies
8086
- # @return [CostsAnomalySettingsNamespace] `client.costs.anomaly_settings`
8087
- attr_reader :anomaly_settings
8088
- # @return [CostsAnomalySuppressionsNamespace] `client.costs.anomaly_suppressions`
8089
- attr_reader :anomaly_suppressions
8090
- # @return [CostsEfficiencyAlertSettingsNamespace] `client.costs.efficiency_alert_settings`
8091
- attr_reader :efficiency_alert_settings
8092
-
8751
+ # `client.costs.exports.jobs`
8752
+ class CostsExportsJobsNamespace
8093
8753
  # @api private
8094
8754
  # @param transport [Transport]
8095
8755
  def initialize(transport)
8096
8756
  @transport = transport
8097
- @anomalies = CostsAnomaliesNamespace.new(@transport)
8098
- @anomaly_settings = CostsAnomalySettingsNamespace.new(@transport)
8099
- @anomaly_suppressions = CostsAnomalySuppressionsNamespace.new(@transport)
8100
- @efficiency_alert_settings = CostsEfficiencyAlertSettingsNamespace.new(@transport)
8101
8757
  end
8102
8758
 
8103
- # Anomaly detection precision over time
8759
+ # Start a background cost export
8104
8760
  #
8105
- # Per month of the anomalous day: findings detected, suppressed, and marked
8106
- # expected or unexpected, and precision (the share of reviewed findings that
8107
- # were real problems).
8761
+ # Queues an export of a saved report (`reportId`) or an ad-hoc scope
8762
+ # (`query`) as CSV, NDJSON or FOCUS CSV, and answers at once with the job.
8763
+ # The file is written on the gateway in the background; poll `GET
8764
+ # /costs/exports/jobs/{jobId}` for `progress` and download from
8765
+ # `downloadUrl` once `status` is `succeeded`. Up to 731 days per job and 256
8766
+ # MB per file; three queued or running jobs per person. Rows are read inside
8767
+ # the caller's cost visibility, and what is exported is fixed when the job
8768
+ # is created, so editing the report afterwards does not change the file.
8108
8769
  #
8109
8770
  # _Requires permission: `costs:read`._
8110
8771
  #
8111
- # GET /api/org/{orgId}/costs/anomaly-precision
8772
+ # POST /api/org/{orgId}/costs/exports/jobs
8112
8773
  #
8113
8774
  # Raises on 400: Bad request
8114
8775
  #
8776
+ # Raises on 404: Not found
8777
+ #
8778
+ # Raises on 409: Conflict
8779
+ #
8115
8780
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
8116
8781
  # constructed with.
8117
- # @param months [String, nil] Months to cover, 1-24. Defaults to 6.
8782
+ # @param body [Hash] Request body, shaped as `CostExportJobRequest`.
8118
8783
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
8119
- # @return [Hash] Parsed JSON, shaped as `CostAnomalyPrecisionReport` — see
8784
+ # @return [Hash] Parsed JSON, shaped as `CostExportJob` — see `sig/infrawrench/sdk.rbs`.
8785
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
8786
+ def create(body:, org_id: nil, request_options: nil)
8787
+ @transport.request(
8788
+ http_method: "POST",
8789
+ path: "/api/org/{orgId}/costs/exports/jobs",
8790
+ path_params: { "orgId" => org_id },
8791
+ body: body,
8792
+ request_options: request_options
8793
+ )
8794
+ end
8795
+
8796
+ # Cancel an export job or delete its file
8797
+ #
8798
+ # Cancels a queued or running job (the writer stops at its next chunk), or
8799
+ # deletes a finished file before it expires. Answers with the job's new
8800
+ # state.
8801
+ #
8802
+ # _Requires permission: `costs:read`._
8803
+ #
8804
+ # DELETE /api/org/{orgId}/costs/exports/jobs/{jobId}
8805
+ #
8806
+ # Raises on 404: Not found
8807
+ #
8808
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
8809
+ # constructed with.
8810
+ # @param job_id [String]
8811
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
8812
+ # @return [Hash] Parsed JSON, shaped as `CostExportJob` — see `sig/infrawrench/sdk.rbs`.
8813
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
8814
+ def delete(job_id:, org_id: nil, request_options: nil)
8815
+ @transport.request(
8816
+ http_method: "DELETE",
8817
+ path: "/api/org/{orgId}/costs/exports/jobs/{jobId}",
8818
+ path_params: { "orgId" => org_id, "jobId" => job_id },
8819
+ request_options: request_options
8820
+ )
8821
+ end
8822
+
8823
+ # Download an export job's file
8824
+ #
8825
+ # The finished file, streamed. 409 while the job is still queued or running
8826
+ # (or failed); 410 once the file has expired or been deleted.
8827
+ #
8828
+ # _Requires permission: `costs:read`._
8829
+ #
8830
+ # GET /api/org/{orgId}/costs/exports/jobs/{jobId}/download
8831
+ #
8832
+ # Raises on 404: Not found
8833
+ #
8834
+ # Raises on 409: Conflict
8835
+ #
8836
+ # Raises on 410: Gone: the file expired or was deleted
8837
+ #
8838
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
8839
+ # constructed with.
8840
+ # @param job_id [String]
8841
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
8842
+ # @return [String] Parsed JSON, shaped as `String` — see `sig/infrawrench/sdk.rbs`.
8843
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
8844
+ def download(job_id:, org_id: nil, request_options: nil)
8845
+ @transport.request(
8846
+ http_method: "GET",
8847
+ path: "/api/org/{orgId}/costs/exports/jobs/{jobId}/download",
8848
+ path_params: { "orgId" => org_id, "jobId" => job_id },
8849
+ request_options: request_options
8850
+ )
8851
+ end
8852
+
8853
+ # List your recent export jobs
8854
+ #
8855
+ # The caller's 20 most recent export jobs, newest first. Jobs are private to
8856
+ # their creator.
8857
+ #
8858
+ # _Requires permission: `costs:read`._
8859
+ #
8860
+ # GET /api/org/{orgId}/costs/exports/jobs
8861
+ #
8862
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
8863
+ # constructed with.
8864
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
8865
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
8866
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
8867
+ def get(org_id: nil, request_options: nil)
8868
+ @transport.request(
8869
+ http_method: "GET",
8870
+ path: "/api/org/{orgId}/costs/exports/jobs",
8871
+ path_params: { "orgId" => org_id },
8872
+ request_options: request_options
8873
+ )
8874
+ end
8875
+
8876
+ # Get an export job's status
8877
+ #
8878
+ # Status, progress, row count, error and, once finished, the download path
8879
+ # and expiry.
8880
+ #
8881
+ # _Requires permission: `costs:read`._
8882
+ #
8883
+ # GET /api/org/{orgId}/costs/exports/jobs/{jobId}
8884
+ #
8885
+ # Raises on 404: Not found
8886
+ #
8887
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
8888
+ # constructed with.
8889
+ # @param job_id [String]
8890
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
8891
+ # @return [Hash] Parsed JSON, shaped as `CostExportJob` — see `sig/infrawrench/sdk.rbs`.
8892
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
8893
+ def get_org_org_id_costs_exports_jobs_job_id(job_id:, org_id: nil, request_options: nil)
8894
+ @transport.request(
8895
+ http_method: "GET",
8896
+ path: "/api/org/{orgId}/costs/exports/jobs/{jobId}",
8897
+ path_params: { "orgId" => org_id, "jobId" => job_id },
8898
+ request_options: request_options
8899
+ )
8900
+ end
8901
+ end
8902
+
8903
+ # `client.costs.exports`
8904
+ class CostsExportsNamespace
8905
+ # @return [CostsExportsJobsNamespace] `client.costs.exports.jobs`
8906
+ attr_reader :jobs
8907
+
8908
+ # @api private
8909
+ # @param transport [Transport]
8910
+ def initialize(transport)
8911
+ @transport = transport
8912
+ @jobs = CostsExportsJobsNamespace.new(@transport)
8913
+ end
8914
+ end
8915
+
8916
+ # `client.costs`
8917
+ class CostsNamespace
8918
+ # @return [CostsAnomaliesNamespace] `client.costs.anomalies`
8919
+ attr_reader :anomalies
8920
+ # @return [CostsAnomalySettingsNamespace] `client.costs.anomaly_settings`
8921
+ attr_reader :anomaly_settings
8922
+ # @return [CostsAnomalySuppressionsNamespace] `client.costs.anomaly_suppressions`
8923
+ attr_reader :anomaly_suppressions
8924
+ # @return [CostsEfficiencyAlertSettingsNamespace] `client.costs.efficiency_alert_settings`
8925
+ attr_reader :efficiency_alert_settings
8926
+ # @return [CostsExportsNamespace] `client.costs.exports`
8927
+ attr_reader :exports
8928
+
8929
+ # @api private
8930
+ # @param transport [Transport]
8931
+ def initialize(transport)
8932
+ @transport = transport
8933
+ @anomalies = CostsAnomaliesNamespace.new(@transport)
8934
+ @anomaly_settings = CostsAnomalySettingsNamespace.new(@transport)
8935
+ @anomaly_suppressions = CostsAnomalySuppressionsNamespace.new(@transport)
8936
+ @efficiency_alert_settings = CostsEfficiencyAlertSettingsNamespace.new(@transport)
8937
+ @exports = CostsExportsNamespace.new(@transport)
8938
+ end
8939
+
8940
+ # Anomaly detection precision over time
8941
+ #
8942
+ # Per month of the anomalous day: findings detected, suppressed, and marked
8943
+ # expected or unexpected, and precision (the share of reviewed findings that
8944
+ # were real problems).
8945
+ #
8946
+ # _Requires permission: `costs:read`._
8947
+ #
8948
+ # GET /api/org/{orgId}/costs/anomaly-precision
8949
+ #
8950
+ # Raises on 400: Bad request
8951
+ #
8952
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
8953
+ # constructed with.
8954
+ # @param months [String, nil] Months to cover, 1-24. Defaults to 6.
8955
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
8956
+ # @return [Hash] Parsed JSON, shaped as `CostAnomalyPrecisionReport` — see
8120
8957
  # `sig/infrawrench/sdk.rbs`.
8121
8958
  # @raise [Infrawrench::ApiError] On any non-2xx response.
8122
8959
  def anomaly_precision(org_id: nil, months: nil, request_options: nil)
@@ -8581,6 +9418,67 @@ module Infrawrench
8581
9418
  )
8582
9419
  end
8583
9420
 
9421
+ # Upload many exchange rates from a CSV
9422
+ #
9423
+ # Upserts every row on (`fromCurrency`, `toCurrency`, `effectiveFrom`),
9424
+ # exactly as the single-rate PUT does, in one transaction. Send `dryRun:
9425
+ # true` first to see each row classified (`create`, `update`, `unchanged`,
9426
+ # `error` with the reason); an upload with an invalid row writes nothing
9427
+ # unless `skipInvalid` is set. Uploaded rates are ordinary stated rates:
9428
+ # they win over the automatic feed for the days they cover, and a
9429
+ # `billing_period` row (or an `effective_to`) hands the days after it back
9430
+ # to the next rate or the feed. Requires `org:settings:write`; applied
9431
+ # uploads are audit-logged as `exchange_rate.import`.
9432
+ #
9433
+ # _Requires permission: `org:settings:write`._
9434
+ #
9435
+ # POST /api/org/{orgId}/currency/rates/import
9436
+ #
9437
+ # Raises on 400: A malformed body, or a whole-file problem; the body is then
9438
+ # the result with `fileError` and `error` set.
9439
+ #
9440
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
9441
+ # constructed with.
9442
+ # @param body [Hash] Request body, shaped as `ExchangeRateImportRequest`.
9443
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
9444
+ # @return [Hash] Parsed JSON, shaped as `ExchangeRateImportResult` — see
9445
+ # `sig/infrawrench/sdk.rbs`.
9446
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
9447
+ def import(body:, org_id: nil, request_options: nil)
9448
+ @transport.request(
9449
+ http_method: "POST",
9450
+ path: "/api/org/{orgId}/currency/rates/import",
9451
+ path_params: { "orgId" => org_id },
9452
+ body: body,
9453
+ request_options: request_options
9454
+ )
9455
+ end
9456
+
9457
+ # CSV template for uploading exchange rates
9458
+ #
9459
+ # The header row `POST /currency/rates/import` reads, plus one example row
9460
+ # per shape: an open-ended rate, a bounded override, and a `billing_period`
9461
+ # row.
9462
+ #
9463
+ # _Requires permission: `costs:read`._
9464
+ #
9465
+ # GET /api/org/{orgId}/currency/rates/template
9466
+ #
9467
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
9468
+ # constructed with.
9469
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
9470
+ # @return [String] Raw response bytes.
9471
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
9472
+ def template(org_id: nil, request_options: nil)
9473
+ @transport.request(
9474
+ http_method: "GET",
9475
+ path: "/api/org/{orgId}/currency/rates/template",
9476
+ path_params: { "orgId" => org_id },
9477
+ accept: :binary,
9478
+ request_options: request_options
9479
+ )
9480
+ end
9481
+
8584
9482
  # Create or replace one exchange rate
8585
9483
  #
8586
9484
  # Upserts on (`fromCurrency`, `toCurrency`, `effectiveFrom`): one rate per
@@ -9268,15 +10166,82 @@ module Infrawrench
9268
10166
  end
9269
10167
  end
9270
10168
 
10169
+ # `client.dashboards.default.me`
10170
+ class DashboardsDefaultMeNamespace
10171
+ # @api private
10172
+ # @param transport [Transport]
10173
+ def initialize(transport)
10174
+ @transport = transport
10175
+ end
10176
+
10177
+ # Clear my default dashboard
10178
+ #
10179
+ # _Requires permission: `dashboards:read`._
10180
+ #
10181
+ # DELETE /api/org/{orgId}/dashboards/default/me
10182
+ #
10183
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
10184
+ # constructed with.
10185
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
10186
+ # @return [Hash] Parsed JSON, shaped as `DefaultDashboardResolution` — see
10187
+ # `sig/infrawrench/sdk.rbs`.
10188
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
10189
+ def delete(org_id: nil, request_options: nil)
10190
+ @transport.request(
10191
+ http_method: "DELETE",
10192
+ path: "/api/org/{orgId}/dashboards/default/me",
10193
+ path_params: { "orgId" => org_id },
10194
+ request_options: request_options
10195
+ )
10196
+ end
10197
+
10198
+ # Set my default dashboard
10199
+ #
10200
+ # Overrides the role and organization defaults for the caller in this
10201
+ # organization. The dashboard must be one the caller can open.
10202
+ #
10203
+ # _Requires permission: `dashboards:read`._
10204
+ #
10205
+ # PUT /api/org/{orgId}/dashboards/default/me
10206
+ #
10207
+ # Raises on 400: Bad request
10208
+ #
10209
+ # Raises on 404: Not found
10210
+ #
10211
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
10212
+ # constructed with.
10213
+ # @param body [Hash] Request body, shaped as `SetDefaultDashboardRequest`.
10214
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
10215
+ # @return [Hash] Parsed JSON, shaped as `DefaultDashboardResolution` — see
10216
+ # `sig/infrawrench/sdk.rbs`.
10217
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
10218
+ def update(body:, org_id: nil, request_options: nil)
10219
+ @transport.request(
10220
+ http_method: "PUT",
10221
+ path: "/api/org/{orgId}/dashboards/default/me",
10222
+ path_params: { "orgId" => org_id },
10223
+ body: body,
10224
+ request_options: request_options
10225
+ )
10226
+ end
10227
+ end
10228
+
9271
10229
  # `client.dashboards.default`
9272
10230
  class DashboardsDefaultNamespace
10231
+ # @return [DashboardsDefaultMeNamespace] `client.dashboards.default.me`
10232
+ attr_reader :me
10233
+
9273
10234
  # @api private
9274
10235
  # @param transport [Transport]
9275
10236
  def initialize(transport)
9276
10237
  @transport = transport
10238
+ @me = DashboardsDefaultMeNamespace.new(@transport)
9277
10239
  end
9278
10240
 
9279
- # Get-or-create the default dashboard with its pins
10241
+ # Get the caller's default dashboard with its pins
10242
+ #
10243
+ # The dashboard `GET /dashboards/default` resolves to, with its cards. The
10244
+ # organization default is created as `Home` on first read.
9280
10245
  #
9281
10246
  # _Requires permission: `dashboards:read`._
9282
10247
  #
@@ -9295,6 +10260,32 @@ module Infrawrench
9295
10260
  request_options: request_options
9296
10261
  )
9297
10262
  end
10263
+
10264
+ # Which dashboard the caller lands on, and why
10265
+ #
10266
+ # Resolves the caller's default dashboard: their own default, else the
10267
+ # default set for their role, else the organization default (created as
10268
+ # `Home` on first read). A layer whose dashboard is no longer shared with
10269
+ # the caller is skipped and listed in `skipped`.
10270
+ #
10271
+ # _Requires permission: `dashboards:read`._
10272
+ #
10273
+ # GET /api/org/{orgId}/dashboards/default
10274
+ #
10275
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
10276
+ # constructed with.
10277
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
10278
+ # @return [Hash] Parsed JSON, shaped as `DefaultDashboardResolution` — see
10279
+ # `sig/infrawrench/sdk.rbs`.
10280
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
10281
+ def get(org_id: nil, request_options: nil)
10282
+ @transport.request(
10283
+ http_method: "GET",
10284
+ path: "/api/org/{orgId}/dashboards/default",
10285
+ path_params: { "orgId" => org_id },
10286
+ request_options: request_options
10287
+ )
10288
+ end
9298
10289
  end
9299
10290
 
9300
10291
  # `client.dashboards.notifications`
@@ -9561,50 +10552,139 @@ module Infrawrench
9561
10552
  end
9562
10553
  end
9563
10554
 
9564
- # `client.dashboards.widgets`
9565
- class DashboardsWidgetsNamespace
10555
+ # `client.dashboards.role_defaults`
10556
+ class DashboardsRoleDefaultsNamespace
9566
10557
  # @api private
9567
10558
  # @param transport [Transport]
9568
10559
  def initialize(transport)
9569
10560
  @transport = transport
9570
10561
  end
9571
10562
 
9572
- # Add a cost-graph or budget widget to a dashboard
10563
+ # Clear a role's default dashboard
9573
10564
  #
9574
- # POST /api/org/{orgId}/dashboards/widgets
10565
+ # _Requires permission: `org:settings:write`._
9575
10566
  #
9576
- # Raises on 400: Bad request
10567
+ # DELETE /api/org/{orgId}/dashboards/role-defaults/{roleId}
9577
10568
  #
9578
10569
  # Raises on 404: Not found
9579
10570
  #
9580
10571
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
9581
10572
  # constructed with.
9582
- # @param body [Hash] Request body, shaped as `CreateWidgetRequest`.
10573
+ # @param role_id [String]
9583
10574
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
9584
- # @return [Hash] Parsed JSON, shaped as `DashboardWidgetFull` — see
9585
- # `sig/infrawrench/sdk.rbs`.
10575
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
9586
10576
  # @raise [Infrawrench::ApiError] On any non-2xx response.
9587
- def create(body:, org_id: nil, request_options: nil)
10577
+ def delete(role_id:, org_id: nil, request_options: nil)
9588
10578
  @transport.request(
9589
- http_method: "POST",
9590
- path: "/api/org/{orgId}/dashboards/widgets",
9591
- path_params: { "orgId" => org_id },
9592
- body: body,
10579
+ http_method: "DELETE",
10580
+ path: "/api/org/{orgId}/dashboards/role-defaults/{roleId}",
10581
+ path_params: { "orgId" => org_id, "roleId" => role_id },
9593
10582
  request_options: request_options
9594
10583
  )
9595
10584
  end
9596
10585
 
9597
- # Remove a widget from a dashboard
10586
+ # List each role's default dashboard
9598
10587
  #
9599
- # DELETE /api/org/{orgId}/dashboards/widgets/{widgetId}
10588
+ # _Requires permission: `team:read`._
9600
10589
  #
9601
- # Raises on 404: Not found
10590
+ # GET /api/org/{orgId}/dashboards/role-defaults
9602
10591
  #
9603
10592
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
9604
10593
  # constructed with.
9605
- # @param widget_id [String]
9606
10594
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
9607
- # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
10595
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<RoleDefaultDashboard>` — see
10596
+ # `sig/infrawrench/sdk.rbs`.
10597
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
10598
+ def list(org_id: nil, request_options: nil)
10599
+ @transport.request(
10600
+ http_method: "GET",
10601
+ path: "/api/org/{orgId}/dashboards/role-defaults",
10602
+ path_params: { "orgId" => org_id },
10603
+ request_options: request_options
10604
+ )
10605
+ end
10606
+
10607
+ # Set a role's default dashboard
10608
+ #
10609
+ # Members holding the role land on this dashboard unless they picked their
10610
+ # own. Refused with 422 when the role lacks `dashboards:read` or the
10611
+ # dashboard is not shared with the role (org-wide or by a role grant). Works
10612
+ # for system and custom roles. Needs `org:settings:write` (not
10613
+ # `team:role:write`), so an API key can manage it.
10614
+ #
10615
+ # _Requires permission: `org:settings:write`._
10616
+ #
10617
+ # PUT /api/org/{orgId}/dashboards/role-defaults/{roleId}
10618
+ #
10619
+ # Raises on 400: Bad request
10620
+ #
10621
+ # Raises on 404: Not found
10622
+ #
10623
+ # Raises on 422: Bad request
10624
+ #
10625
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
10626
+ # constructed with.
10627
+ # @param role_id [String]
10628
+ # @param body [Hash] Request body, shaped as `SetDefaultDashboardRequest`.
10629
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
10630
+ # @return [Hash] Parsed JSON, shaped as `RoleDefaultDashboard` — see
10631
+ # `sig/infrawrench/sdk.rbs`.
10632
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
10633
+ def update(role_id:, body:, org_id: nil, request_options: nil)
10634
+ @transport.request(
10635
+ http_method: "PUT",
10636
+ path: "/api/org/{orgId}/dashboards/role-defaults/{roleId}",
10637
+ path_params: { "orgId" => org_id, "roleId" => role_id },
10638
+ body: body,
10639
+ request_options: request_options
10640
+ )
10641
+ end
10642
+ end
10643
+
10644
+ # `client.dashboards.widgets`
10645
+ class DashboardsWidgetsNamespace
10646
+ # @api private
10647
+ # @param transport [Transport]
10648
+ def initialize(transport)
10649
+ @transport = transport
10650
+ end
10651
+
10652
+ # Add a widget (cost graph, report, budget, KPI, text, ...) to a dashboard
10653
+ #
10654
+ # POST /api/org/{orgId}/dashboards/widgets
10655
+ #
10656
+ # Raises on 400: Bad request
10657
+ #
10658
+ # Raises on 404: Not found
10659
+ #
10660
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
10661
+ # constructed with.
10662
+ # @param body [Hash] Request body, shaped as `CreateWidgetRequest`.
10663
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
10664
+ # @return [Hash] Parsed JSON, shaped as `DashboardWidgetFull` — see
10665
+ # `sig/infrawrench/sdk.rbs`.
10666
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
10667
+ def create(body:, org_id: nil, request_options: nil)
10668
+ @transport.request(
10669
+ http_method: "POST",
10670
+ path: "/api/org/{orgId}/dashboards/widgets",
10671
+ path_params: { "orgId" => org_id },
10672
+ body: body,
10673
+ request_options: request_options
10674
+ )
10675
+ end
10676
+
10677
+ # Remove a widget from a dashboard
10678
+ #
10679
+ # DELETE /api/org/{orgId}/dashboards/widgets/{widgetId}
10680
+ #
10681
+ # Raises on 404: Not found
10682
+ #
10683
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
10684
+ # constructed with.
10685
+ # @param widget_id [String]
10686
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
10687
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
9608
10688
  # @raise [Infrawrench::ApiError] On any non-2xx response.
9609
10689
  def delete(widget_id:, org_id: nil, request_options: nil)
9610
10690
  @transport.request(
@@ -9615,6 +10695,35 @@ module Infrawrench
9615
10695
  )
9616
10696
  end
9617
10697
 
10698
+ # Copy a widget in place
10699
+ #
10700
+ # Inserts a copy with the same kind, config and size directly after the
10701
+ # original, moving every card behind it one slot along. A copy of a budget
10702
+ # or report card is a second view onto the same budget or report.
10703
+ # Audit-logged.
10704
+ #
10705
+ # POST /api/org/{orgId}/dashboards/widgets/{widgetId}/duplicate
10706
+ #
10707
+ # Raises on 400: Bad request
10708
+ #
10709
+ # Raises on 404: Not found
10710
+ #
10711
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
10712
+ # constructed with.
10713
+ # @param widget_id [String]
10714
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
10715
+ # @return [Hash] Parsed JSON, shaped as `DashboardWidgetFull` — see
10716
+ # `sig/infrawrench/sdk.rbs`.
10717
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
10718
+ def duplicate(widget_id:, org_id: nil, request_options: nil)
10719
+ @transport.request(
10720
+ http_method: "POST",
10721
+ path: "/api/org/{orgId}/dashboards/widgets/{widgetId}/duplicate",
10722
+ path_params: { "orgId" => org_id, "widgetId" => widget_id },
10723
+ request_options: request_options
10724
+ )
10725
+ end
10726
+
9618
10727
  # Update a widget's title, config, or layout
9619
10728
  #
9620
10729
  # PATCH /api/org/{orgId}/dashboards/widgets/{widgetId}
@@ -9650,6 +10759,8 @@ module Infrawrench
9650
10759
  attr_reader :notifications
9651
10760
  # @return [DashboardsPinNamespace] `client.dashboards.pin`
9652
10761
  attr_reader :pin
10762
+ # @return [DashboardsRoleDefaultsNamespace] `client.dashboards.role_defaults`
10763
+ attr_reader :role_defaults
9653
10764
  # @return [DashboardsWidgetsNamespace] `client.dashboards.widgets`
9654
10765
  attr_reader :widgets
9655
10766
 
@@ -9660,6 +10771,7 @@ module Infrawrench
9660
10771
  @default = DashboardsDefaultNamespace.new(@transport)
9661
10772
  @notifications = DashboardsNotificationsNamespace.new(@transport)
9662
10773
  @pin = DashboardsPinNamespace.new(@transport)
10774
+ @role_defaults = DashboardsRoleDefaultsNamespace.new(@transport)
9663
10775
  @widgets = DashboardsWidgetsNamespace.new(@transport)
9664
10776
  end
9665
10777
 
@@ -9735,6 +10847,37 @@ module Infrawrench
9735
10847
  )
9736
10848
  end
9737
10849
 
10850
+ # Evaluate a KPI widget config
10851
+ #
10852
+ # Answers one KPI config: a saved card posts its own, an editor posts one to
10853
+ # preview it. Needs `costs:read`, plus `budgets:read` for a budget source;
10854
+ # figures are measured inside the caller's cost visibility scope.
10855
+ #
10856
+ # POST /api/org/{orgId}/dashboards/kpi
10857
+ #
10858
+ # Raises on 400: Bad request
10859
+ #
10860
+ # Raises on 403: Forbidden
10861
+ #
10862
+ # Raises on 404: Not found
10863
+ #
10864
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
10865
+ # constructed with.
10866
+ # @param body [Hash] Request body, shaped as `DashboardKpiRequest`.
10867
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
10868
+ # @return [Hash] Parsed JSON, shaped as `DashboardKpiResult` — see
10869
+ # `sig/infrawrench/sdk.rbs`.
10870
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
10871
+ def kpi(body:, org_id: nil, request_options: nil)
10872
+ @transport.request(
10873
+ http_method: "POST",
10874
+ path: "/api/org/{orgId}/dashboards/kpi",
10875
+ path_params: { "orgId" => org_id },
10876
+ body: body,
10877
+ request_options: request_options
10878
+ )
10879
+ end
10880
+
9738
10881
  # List dashboards
9739
10882
  #
9740
10883
  # _Requires permission: `dashboards:read`._
@@ -11965,6 +13108,74 @@ module Infrawrench
11965
13108
  end
11966
13109
  end
11967
13110
 
13111
+ # `client.github_issues.links`
13112
+ class GithubIssuesLinksNamespace
13113
+ # @api private
13114
+ # @param transport [Transport]
13115
+ def initialize(transport)
13116
+ @transport = transport
13117
+ end
13118
+
13119
+ # Look up filed GitHub issues for a set of findings
13120
+ #
13121
+ # _Requires permission: `github-issues:read`._
13122
+ #
13123
+ # GET /api/org/{orgId}/github-issues/links
13124
+ #
13125
+ # Raises on 400: Bad request
13126
+ #
13127
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13128
+ # constructed with.
13129
+ # @param source_kind [String, nil]
13130
+ # @param state [String, nil]
13131
+ # @param source_id [Array<String>, nil]
13132
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13133
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<GithubIssueLink>` — see
13134
+ # `sig/infrawrench/sdk.rbs`.
13135
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
13136
+ def list(org_id: nil, source_kind: nil, state: nil, source_id: nil, request_options: nil)
13137
+ @transport.request(
13138
+ http_method: "GET",
13139
+ path: "/api/org/{orgId}/github-issues/links",
13140
+ path_params: { "orgId" => org_id },
13141
+ query: { "sourceKind" => source_kind, "state" => state, "sourceId" => source_id },
13142
+ request_options: request_options
13143
+ )
13144
+ end
13145
+
13146
+ # Refresh the status of filed GitHub issues now
13147
+ #
13148
+ # Reads up to 200 of the org's filed issues from GitHub (least recently
13149
+ # checked first) instead of waiting for the App's webhook or the poll. An
13150
+ # issue GitHub no longer has is recorded as deleted.
13151
+ #
13152
+ # _Requires permission: `github-issues:read`._
13153
+ #
13154
+ # POST /api/org/{orgId}/github-issues/links/refresh
13155
+ #
13156
+ # Raises on 400: Bad request
13157
+ #
13158
+ # Raises on 409: The GitHub App installation needs a permission an owner has
13159
+ # not approved yet
13160
+ #
13161
+ # Raises on 502: GitHub refused the request or was unreachable
13162
+ #
13163
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13164
+ # constructed with.
13165
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13166
+ # @return [Hash] Parsed JSON, shaped as `IssueStatusRefreshResult` — see
13167
+ # `sig/infrawrench/sdk.rbs`.
13168
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
13169
+ def refresh(org_id: nil, request_options: nil)
13170
+ @transport.request(
13171
+ http_method: "POST",
13172
+ path: "/api/org/{orgId}/github-issues/links/refresh",
13173
+ path_params: { "orgId" => org_id },
13174
+ request_options: request_options
13175
+ )
13176
+ end
13177
+ end
13178
+
11968
13179
  # `client.github_issues.pull_requests`
11969
13180
  class GithubIssuesPullRequestsNamespace
11970
13181
  # @api private
@@ -12042,6 +13253,8 @@ module Infrawrench
12042
13253
 
12043
13254
  # `client.github_issues`
12044
13255
  class GithubIssuesNamespace
13256
+ # @return [GithubIssuesLinksNamespace] `client.github_issues.links`
13257
+ attr_reader :links
12045
13258
  # @return [GithubIssuesPullRequestsNamespace] `client.github_issues.pull_requests`
12046
13259
  attr_reader :pull_requests
12047
13260
 
@@ -12049,6 +13262,7 @@ module Infrawrench
12049
13262
  # @param transport [Transport]
12050
13263
  def initialize(transport)
12051
13264
  @transport = transport
13265
+ @links = GithubIssuesLinksNamespace.new(@transport)
12052
13266
  @pull_requests = GithubIssuesPullRequestsNamespace.new(@transport)
12053
13267
  end
12054
13268
 
@@ -12206,33 +13420,6 @@ module Infrawrench
12206
13420
  )
12207
13421
  end
12208
13422
 
12209
- # Look up filed GitHub issues for a set of findings
12210
- #
12211
- # _Requires permission: `github-issues:read`._
12212
- #
12213
- # GET /api/org/{orgId}/github-issues/links
12214
- #
12215
- # Raises on 400: Bad request
12216
- #
12217
- # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12218
- # constructed with.
12219
- # @param source_kind [String, nil]
12220
- # @param state [String, nil]
12221
- # @param source_id [Array<String>, nil]
12222
- # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12223
- # @return [Array<Hash>] Parsed JSON, shaped as `Array<GithubIssueLink>` — see
12224
- # `sig/infrawrench/sdk.rbs`.
12225
- # @raise [Infrawrench::ApiError] On any non-2xx response.
12226
- def links(org_id: nil, source_kind: nil, state: nil, source_id: nil, request_options: nil)
12227
- @transport.request(
12228
- http_method: "GET",
12229
- path: "/api/org/{orgId}/github-issues/links",
12230
- path_params: { "orgId" => org_id },
12231
- query: { "sourceKind" => source_kind, "state" => state, "sourceId" => source_id },
12232
- request_options: request_options
12233
- )
12234
- end
12235
-
12236
13423
  # Resolve where a finding would be filed
12237
13424
  #
12238
13425
  # _Requires permission: `github-issues:read`._
@@ -12471,92 +13658,219 @@ module Infrawrench
12471
13658
  end
12472
13659
  end
12473
13660
 
12474
- # `client.incidents.get`
12475
- class IncidentsGetNamespace
13661
+ # `client.idle_findings.settings`
13662
+ class IdleFindingsSettingsNamespace
12476
13663
  # @api private
12477
13664
  # @param transport [Transport]
12478
13665
  def initialize(transport)
12479
13666
  @transport = transport
12480
13667
  end
12481
13668
 
12482
- # List declared incidents
13669
+ # Get the organization's idle-rule settings
12483
13670
  #
12484
- # Every incident the organization has declared, newest first, each with the
12485
- # artefacts its declaration created: including the ones that failed.
13671
+ # An organization that never saved reads the shipped defaults (enabled, 14
13672
+ # days).
12486
13673
  #
12487
- # _Requires permission: `incidents:read`._
13674
+ # _Requires permission: `org:settings:write`._
12488
13675
  #
12489
- # GET /api/org/{orgId}/incidents
13676
+ # GET /api/org/{orgId}/idle-findings/settings
12490
13677
  #
12491
13678
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12492
13679
  # constructed with.
12493
- # @param status [String, nil] `open`, `mitigated`, `resolved`, or `all` (the default).
12494
13680
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12495
- # @return [Hash] Parsed JSON, shaped as `IncidentList` — see `sig/infrawrench/sdk.rbs`.
13681
+ # @return [Hash] Parsed JSON, shaped as `IdleFindingSettings` — see
13682
+ # `sig/infrawrench/sdk.rbs`.
12496
13683
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12497
- def get(org_id: nil, status: nil, request_options: nil)
13684
+ def get(org_id: nil, request_options: nil)
12498
13685
  @transport.request(
12499
13686
  http_method: "GET",
12500
- path: "/api/org/{orgId}/incidents",
13687
+ path: "/api/org/{orgId}/idle-findings/settings",
12501
13688
  path_params: { "orgId" => org_id },
12502
- query: { "status" => status },
12503
13689
  request_options: request_options
12504
13690
  )
12505
13691
  end
12506
13692
 
12507
- # Read one incident
13693
+ # Update the idle-rule settings
12508
13694
  #
12509
- # The incident with its artefacts and its operator notes.
13695
+ # Every field is optional. `lookbackDays` must be a whole number from 7 to
13696
+ # 42; an unknown rule or threshold key, or a threshold outside its declared
13697
+ # range, is rejected rather than clamped. Any change makes every account due
13698
+ # for a fresh collection.
12510
13699
  #
12511
- # _Requires permission: `incidents:read`._
13700
+ # _Requires permission: `org:settings:write`._
12512
13701
  #
12513
- # GET /api/org/{orgId}/incidents/{incidentId}
13702
+ # PUT /api/org/{orgId}/idle-findings/settings
12514
13703
  #
12515
- # Raises on 404: Not found
13704
+ # Raises on 400: Bad request
12516
13705
  #
12517
13706
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12518
13707
  # constructed with.
12519
- # @param incident_id [String]
13708
+ # @param body [Hash, nil] Request body, shaped as `IdleFindingSettingsUpdate`.
12520
13709
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12521
- # @return [Hash] Parsed JSON, shaped as `IncidentDetail` — see `sig/infrawrench/sdk.rbs`.
13710
+ # @return [Hash] Parsed JSON, shaped as `IdleFindingSettings` — see
13711
+ # `sig/infrawrench/sdk.rbs`.
12522
13712
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12523
- def get_org_org_id_incidents_incident_id(incident_id:, org_id: nil, request_options: nil)
13713
+ def update(org_id: nil, body: nil, request_options: nil)
12524
13714
  @transport.request(
12525
- http_method: "GET",
12526
- path: "/api/org/{orgId}/incidents/{incidentId}",
12527
- path_params: { "orgId" => org_id, "incidentId" => incident_id },
13715
+ http_method: "PUT",
13716
+ path: "/api/org/{orgId}/idle-findings/settings",
13717
+ path_params: { "orgId" => org_id },
13718
+ body: body,
12528
13719
  request_options: request_options
12529
13720
  )
12530
13721
  end
12531
13722
  end
12532
13723
 
12533
- # `client.incidents.notes`
12534
- class IncidentsNotesNamespace
13724
+ # `client.idle_findings`
13725
+ class IdleFindingsNamespace
13726
+ # @return [IdleFindingsSettingsNamespace] `client.idle_findings.settings`
13727
+ attr_reader :settings
13728
+
12535
13729
  # @api private
12536
13730
  # @param transport [Transport]
12537
13731
  def initialize(transport)
12538
13732
  @transport = transport
13733
+ @settings = IdleFindingsSettingsNamespace.new(@transport)
12539
13734
  end
12540
13735
 
12541
- # Add an operator note
12542
- #
12543
- # The running commentary no join can reconstruct. `occurredAt` may be
12544
- # backdated so a note typed at 04:00 lands on the timeline where it belongs.
12545
- #
12546
- # _Requires permission: `incidents:write`._
13736
+ # Idle rules, their settings and collection status
12547
13737
  #
12548
- # POST /api/org/{orgId}/incidents/{incidentId}/notes
13738
+ # Every metric-based idle rule the loaded plugins declare (idle NAT
13739
+ # gateways, load balancers, caches, provisioned tables, clusters, unused
13740
+ # custom metrics), with the organization's effective thresholds, plus each
13741
+ # account's last collection and error. The findings themselves are rows of
13742
+ # `GET /orphans` with `idle` set.
12549
13743
  #
12550
- # Raises on 400: Bad request
13744
+ # _Requires permission: `resources:read`._
12551
13745
  #
12552
- # Raises on 404: Not found
13746
+ # GET /api/org/{orgId}/idle-findings
12553
13747
  #
12554
13748
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12555
13749
  # constructed with.
12556
- # @param incident_id [String]
12557
- # @param body [Hash, nil] Request body, shaped as `IncidentNoteCreate`.
12558
13750
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12559
- # @return [Hash] Parsed JSON, shaped as `IncidentNote` — see `sig/infrawrench/sdk.rbs`.
13751
+ # @return [Hash] Parsed JSON, shaped as `IdleFindingsOverview` — see
13752
+ # `sig/infrawrench/sdk.rbs`.
13753
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
13754
+ def get(org_id: nil, request_options: nil)
13755
+ @transport.request(
13756
+ http_method: "GET",
13757
+ path: "/api/org/{orgId}/idle-findings",
13758
+ path_params: { "orgId" => org_id },
13759
+ request_options: request_options
13760
+ )
13761
+ end
13762
+
13763
+ # Re-scan idle rules now
13764
+ #
13765
+ # Makes every account due for an idle collection on the next poller tick.
13766
+ # The reads are billed to the organization's own cloud accounts (CloudWatch
13767
+ # GetMetricData and the like).
13768
+ #
13769
+ # _Requires permission: `org:settings:write`._
13770
+ #
13771
+ # POST /api/org/{orgId}/idle-findings/rescan
13772
+ #
13773
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13774
+ # constructed with.
13775
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13776
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
13777
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
13778
+ def rescan(org_id: nil, request_options: nil)
13779
+ @transport.request(
13780
+ http_method: "POST",
13781
+ path: "/api/org/{orgId}/idle-findings/rescan",
13782
+ path_params: { "orgId" => org_id },
13783
+ request_options: request_options
13784
+ )
13785
+ end
13786
+ end
13787
+
13788
+ # `client.incidents.get`
13789
+ class IncidentsGetNamespace
13790
+ # @api private
13791
+ # @param transport [Transport]
13792
+ def initialize(transport)
13793
+ @transport = transport
13794
+ end
13795
+
13796
+ # List declared incidents
13797
+ #
13798
+ # Every incident the organization has declared, newest first, each with the
13799
+ # artefacts its declaration created: including the ones that failed.
13800
+ #
13801
+ # _Requires permission: `incidents:read`._
13802
+ #
13803
+ # GET /api/org/{orgId}/incidents
13804
+ #
13805
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13806
+ # constructed with.
13807
+ # @param status [String, nil] `open`, `mitigated`, `resolved`, or `all` (the default).
13808
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13809
+ # @return [Hash] Parsed JSON, shaped as `IncidentList` — see `sig/infrawrench/sdk.rbs`.
13810
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
13811
+ def get(org_id: nil, status: nil, request_options: nil)
13812
+ @transport.request(
13813
+ http_method: "GET",
13814
+ path: "/api/org/{orgId}/incidents",
13815
+ path_params: { "orgId" => org_id },
13816
+ query: { "status" => status },
13817
+ request_options: request_options
13818
+ )
13819
+ end
13820
+
13821
+ # Read one incident
13822
+ #
13823
+ # The incident with its artefacts and its operator notes.
13824
+ #
13825
+ # _Requires permission: `incidents:read`._
13826
+ #
13827
+ # GET /api/org/{orgId}/incidents/{incidentId}
13828
+ #
13829
+ # Raises on 404: Not found
13830
+ #
13831
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13832
+ # constructed with.
13833
+ # @param incident_id [String]
13834
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13835
+ # @return [Hash] Parsed JSON, shaped as `IncidentDetail` — see `sig/infrawrench/sdk.rbs`.
13836
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
13837
+ def get_org_org_id_incidents_incident_id(incident_id:, org_id: nil, request_options: nil)
13838
+ @transport.request(
13839
+ http_method: "GET",
13840
+ path: "/api/org/{orgId}/incidents/{incidentId}",
13841
+ path_params: { "orgId" => org_id, "incidentId" => incident_id },
13842
+ request_options: request_options
13843
+ )
13844
+ end
13845
+ end
13846
+
13847
+ # `client.incidents.notes`
13848
+ class IncidentsNotesNamespace
13849
+ # @api private
13850
+ # @param transport [Transport]
13851
+ def initialize(transport)
13852
+ @transport = transport
13853
+ end
13854
+
13855
+ # Add an operator note
13856
+ #
13857
+ # The running commentary no join can reconstruct. `occurredAt` may be
13858
+ # backdated so a note typed at 04:00 lands on the timeline where it belongs.
13859
+ #
13860
+ # _Requires permission: `incidents:write`._
13861
+ #
13862
+ # POST /api/org/{orgId}/incidents/{incidentId}/notes
13863
+ #
13864
+ # Raises on 400: Bad request
13865
+ #
13866
+ # Raises on 404: Not found
13867
+ #
13868
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13869
+ # constructed with.
13870
+ # @param incident_id [String]
13871
+ # @param body [Hash, nil] Request body, shaped as `IncidentNoteCreate`.
13872
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13873
+ # @return [Hash] Parsed JSON, shaped as `IncidentNote` — see `sig/infrawrench/sdk.rbs`.
12560
13874
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12561
13875
  def create(incident_id:, org_id: nil, body: nil, request_options: nil)
12562
13876
  @transport.request(
@@ -13060,11 +14374,40 @@ module Infrawrench
13060
14374
  )
13061
14375
  end
13062
14376
 
14377
+ # Download an invoice as PDF
14378
+ #
14379
+ # The document a customer files: addressee, lines, tax, total, due date and
14380
+ # remittance details, from the billing block frozen at approval. A draft is
14381
+ # watermarked. The collected-versus-adjusted derivation stays in the CSV.
14382
+ #
14383
+ # _Requires permission: `invoices:read`._
14384
+ #
14385
+ # GET /api/org/{orgId}/invoices/{id}/pdf
14386
+ #
14387
+ # Raises on 404: Not found
14388
+ #
14389
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14390
+ # constructed with.
14391
+ # @param id [String]
14392
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14393
+ # @return [String] Raw response bytes.
14394
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14395
+ def pdf(id:, org_id: nil, request_options: nil)
14396
+ @transport.request(
14397
+ http_method: "GET",
14398
+ path: "/api/org/{orgId}/invoices/{id}/pdf",
14399
+ path_params: { "orgId" => org_id, "id" => id },
14400
+ accept: :binary,
14401
+ request_options: request_options
14402
+ )
14403
+ end
14404
+
13063
14405
  # Send an invoice to its customer
13064
14406
  #
13065
14407
  # Changes no figure; the document was frozen at approval. It records the
13066
14408
  # **release** (this may go to the customer, and this person said so), then
13067
- # emails the invoice to the customer's contact addresses with the CSV
14409
+ # emails the invoice to the customer's contact addresses and its billing
14410
+ # profile's To and Cc, as frozen at approval, with the PDF and the CSV
13068
14411
  # attached.
13069
14412
  #
13070
14413
  # **200 even when delivery failed.** The release happened and is recorded
@@ -13177,182 +14520,416 @@ module Infrawrench
13177
14520
  end
13178
14521
  end
13179
14522
 
13180
- # `client.jira.projects`
13181
- class JiraProjectsNamespace
14523
+ # `client.issue_webhooks.jira`
14524
+ class IssueWebhooksJiraNamespace
13182
14525
  # @api private
13183
14526
  # @param transport [Transport]
13184
14527
  def initialize(transport)
13185
14528
  @transport = transport
13186
14529
  end
13187
14530
 
13188
- # List issue types valid in a project
14531
+ # Inbound Jira webhook for issue status
13189
14532
  #
13190
- # Reads the project's own create metadata rather than the global issue-type
13191
- # list, so the picker cannot offer a type the project's scheme would reject.
13192
- # Subtasks are excluded.
14533
+ # Called by Jira, not by clients. The token in the path picks the
14534
+ # organization; `X-Hub-Signature: sha256=<hex>`, an HMAC of the raw body
14535
+ # with the stored secret, authenticates the delivery. Handles
14536
+ # `jira:issue_updated` and `jira:issue_deleted`.
13193
14537
  #
13194
- # _Requires permission: `jira:read`._
14538
+ # POST /api/issue-webhooks/jira/{token}
13195
14539
  #
13196
- # GET /api/org/{orgId}/jira/projects/{key}/issue-types
14540
+ # Raises on 401: The signature did not verify
13197
14541
  #
13198
- # Raises on 400: Bad request
14542
+ # Raises on 404: Unknown token, or (GitHub) no webhook secret configured on
14543
+ # the server
13199
14544
  #
13200
- # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13201
- # constructed with.
13202
- # @param key [String]
14545
+ # Raises on 500: Processing failed; the tracker retries
14546
+ #
14547
+ # @param token [String]
13203
14548
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13204
- # @return [Array<Hash>] Parsed JSON, shaped as `Array<JiraIssueType>` — see
13205
- # `sig/infrawrench/sdk.rbs`.
14549
+ # @return [nil] This endpoint returns no content.
13206
14550
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13207
- def issue_types(key:, org_id: nil, request_options: nil)
14551
+ def create(token:, request_options: nil)
13208
14552
  @transport.request(
13209
- http_method: "GET",
13210
- path: "/api/org/{orgId}/jira/projects/{key}/issue-types",
13211
- path_params: { "orgId" => org_id, "key" => key },
14553
+ http_method: "POST",
14554
+ path: "/api/issue-webhooks/jira/{token}",
14555
+ path_params: { "token" => token },
14556
+ accept: :empty,
13212
14557
  request_options: request_options
13213
14558
  )
13214
14559
  end
14560
+ end
13215
14561
 
13216
- # List Jira projects
14562
+ # `client.issue_webhooks.linear`
14563
+ class IssueWebhooksLinearNamespace
14564
+ # @api private
14565
+ # @param transport [Transport]
14566
+ def initialize(transport)
14567
+ @transport = transport
14568
+ end
14569
+
14570
+ # Inbound Linear webhook for issue status
13217
14571
  #
13218
- # Backs the project picker, so nobody has to know a project key by hand.
14572
+ # Called by Linear, not by clients. The token in the path picks the
14573
+ # organization; `Linear-Signature` (hex HMAC-SHA256 of the raw body)
14574
+ # authenticates the delivery, and `webhookTimestamp` must be within a
14575
+ # minute. Handles `Issue` create, update and remove.
13219
14576
  #
13220
- # _Requires permission: `jira:read`._
14577
+ # POST /api/issue-webhooks/linear/{token}
13221
14578
  #
13222
- # GET /api/org/{orgId}/jira/projects
14579
+ # Raises on 401: The signature did not verify
13223
14580
  #
13224
- # Raises on 400: Bad request
14581
+ # Raises on 404: Unknown token, or (GitHub) no webhook secret configured on
14582
+ # the server
13225
14583
  #
13226
- # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13227
- # constructed with.
14584
+ # Raises on 500: Processing failed; the tracker retries
14585
+ #
14586
+ # @param token [String]
13228
14587
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13229
- # @return [Array<Hash>] Parsed JSON, shaped as `Array<JiraProject>` — see
13230
- # `sig/infrawrench/sdk.rbs`.
14588
+ # @return [nil] This endpoint returns no content.
13231
14589
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13232
- def list(org_id: nil, request_options: nil)
14590
+ def create(token:, request_options: nil)
13233
14591
  @transport.request(
13234
- http_method: "GET",
13235
- path: "/api/org/{orgId}/jira/projects",
13236
- path_params: { "orgId" => org_id },
14592
+ http_method: "POST",
14593
+ path: "/api/issue-webhooks/linear/{token}",
14594
+ path_params: { "token" => token },
14595
+ accept: :empty,
13237
14596
  request_options: request_options
13238
14597
  )
13239
14598
  end
13240
14599
  end
13241
14600
 
13242
- # `client.jira`
13243
- class JiraNamespace
13244
- # @return [JiraProjectsNamespace] `client.jira.projects`
13245
- attr_reader :projects
14601
+ # `client.issue_webhooks`
14602
+ class IssueWebhooksNamespace
14603
+ # @return [IssueWebhooksJiraNamespace] `client.issue_webhooks.jira`
14604
+ attr_reader :jira
14605
+ # @return [IssueWebhooksLinearNamespace] `client.issue_webhooks.linear`
14606
+ attr_reader :linear
13246
14607
 
13247
14608
  # @api private
13248
14609
  # @param transport [Transport]
13249
14610
  def initialize(transport)
13250
14611
  @transport = transport
13251
- @projects = JiraProjectsNamespace.new(@transport)
14612
+ @jira = IssueWebhooksJiraNamespace.new(@transport)
14613
+ @linear = IssueWebhooksLinearNamespace.new(@transport)
13252
14614
  end
13253
14615
 
13254
- # Disconnect Jira
14616
+ # Inbound GitHub App webhook for issue status
13255
14617
  #
13256
- # Issue links already recorded are kept, so filed findings stay marked as
13257
- # filed.
14618
+ # The GitHub App's webhook URL. `X-Hub-Signature-256` is verified with the
14619
+ # server's `GITHUB_APP_WEBHOOK_SECRET`; `issues` events update the status of
14620
+ # filed issues and `ping` is acknowledged. Every other event is ignored.
13258
14621
  #
13259
- # _Requires permission: `jira:write`._
14622
+ # POST /api/issue-webhooks/github
13260
14623
  #
13261
- # DELETE /api/org/{orgId}/jira
14624
+ # Raises on 401: The signature did not verify
13262
14625
  #
13263
- # Raises on 404: Not found
14626
+ # Raises on 404: Unknown token, or (GitHub) no webhook secret configured on
14627
+ # the server
14628
+ #
14629
+ # Raises on 500: Processing failed; the tracker retries
13264
14630
  #
13265
- # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13266
- # constructed with.
13267
14631
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13268
- # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
14632
+ # @return [nil] This endpoint returns no content.
13269
14633
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13270
- def delete(org_id: nil, request_options: nil)
14634
+ def github(request_options: nil)
13271
14635
  @transport.request(
13272
- http_method: "DELETE",
13273
- path: "/api/org/{orgId}/jira",
13274
- path_params: { "orgId" => org_id },
14636
+ http_method: "POST",
14637
+ path: "/api/issue-webhooks/github",
14638
+ accept: :empty,
13275
14639
  request_options: request_options
13276
14640
  )
13277
14641
  end
14642
+ end
13278
14643
 
13279
- # Get the org's Jira connection
13280
- #
13281
- # The stored API token is never returned; `tokenHint` stands in for it.
14644
+ # `client.jira.links`
14645
+ class JiraLinksNamespace
14646
+ # @api private
14647
+ # @param transport [Transport]
14648
+ def initialize(transport)
14649
+ @transport = transport
14650
+ end
14651
+
14652
+ # Look up filed issues for a set of findings
13282
14653
  #
13283
14654
  # _Requires permission: `jira:read`._
13284
14655
  #
13285
- # GET /api/org/{orgId}/jira
14656
+ # GET /api/org/{orgId}/jira/links
14657
+ #
14658
+ # Raises on 400: Bad request
13286
14659
  #
13287
14660
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13288
14661
  # constructed with.
14662
+ # @param source_kind [String, nil]
14663
+ # @param source_id [Array<String>, nil] Repeat to narrow to specific findings. Omit to
14664
+ # return every link of the kind; this is the batch lookup a list view makes once instead of
14665
+ # one request per row.
13289
14666
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13290
- # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
14667
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<JiraIssueLink>` — see
14668
+ # `sig/infrawrench/sdk.rbs`.
13291
14669
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13292
- def get(org_id: nil, request_options: nil)
14670
+ def list(org_id: nil, source_kind: nil, source_id: nil, request_options: nil)
13293
14671
  @transport.request(
13294
14672
  http_method: "GET",
13295
- path: "/api/org/{orgId}/jira",
14673
+ path: "/api/org/{orgId}/jira/links",
13296
14674
  path_params: { "orgId" => org_id },
14675
+ query: { "sourceKind" => source_kind, "sourceId" => source_id },
13297
14676
  request_options: request_options
13298
14677
  )
13299
14678
  end
13300
14679
 
13301
- # File a finding as a Jira issue
14680
+ # Refresh the status of filed Jira issues now
13302
14681
  #
13303
- # Creates the issue, then records the link between it and the finding. The
13304
- # link is what lets a list view show "already filed" instead of offering the
13305
- # button again.
14682
+ # Reads up to 200 of the org's filed issues from Jira (least recently
14683
+ # checked first) instead of waiting for a webhook or the poll.
13306
14684
  #
13307
- # _Requires permission: `jira:write`._
14685
+ # _Requires permission: `jira:read`._
13308
14686
  #
13309
- # POST /api/org/{orgId}/jira/issues
14687
+ # POST /api/org/{orgId}/jira/links/refresh
13310
14688
  #
13311
14689
  # Raises on 400: Bad request
13312
14690
  #
13313
- # Raises on 502: Jira refused to create the issue, or was unreachable
14691
+ # Raises on 502: Jira refused or was unreachable
13314
14692
  #
13315
14693
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13316
14694
  # constructed with.
13317
- # @param body [Hash] Request body, shaped as `CreateJiraIssueInput`.
13318
14695
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13319
- # @return [Hash] Parsed JSON, shaped as `CreateJiraIssueResult` — see
14696
+ # @return [Hash] Parsed JSON, shaped as `IssueStatusRefreshResult` — see
13320
14697
  # `sig/infrawrench/sdk.rbs`.
13321
14698
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13322
- def issues(body:, org_id: nil, request_options: nil)
14699
+ def refresh(org_id: nil, request_options: nil)
13323
14700
  @transport.request(
13324
14701
  http_method: "POST",
13325
- path: "/api/org/{orgId}/jira/issues",
14702
+ path: "/api/org/{orgId}/jira/links/refresh",
13326
14703
  path_params: { "orgId" => org_id },
13327
- body: body,
13328
14704
  request_options: request_options
13329
14705
  )
13330
14706
  end
14707
+ end
13331
14708
 
13332
- # Look up filed issues for a set of findings
13333
- #
14709
+ # `client.jira.projects`
14710
+ class JiraProjectsNamespace
14711
+ # @api private
14712
+ # @param transport [Transport]
14713
+ def initialize(transport)
14714
+ @transport = transport
14715
+ end
14716
+
14717
+ # List issue types valid in a project
14718
+ #
14719
+ # Reads the project's own create metadata rather than the global issue-type
14720
+ # list, so the picker cannot offer a type the project's scheme would reject.
14721
+ # Subtasks are excluded.
14722
+ #
13334
14723
  # _Requires permission: `jira:read`._
13335
14724
  #
13336
- # GET /api/org/{orgId}/jira/links
14725
+ # GET /api/org/{orgId}/jira/projects/{key}/issue-types
13337
14726
  #
13338
14727
  # Raises on 400: Bad request
13339
14728
  #
13340
14729
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13341
14730
  # constructed with.
13342
- # @param source_kind [String, nil]
13343
- # @param source_id [Array<String>, nil] Repeat to narrow to specific findings. Omit to
13344
- # return every link of the kind; this is the batch lookup a list view makes once instead of
13345
- # one request per row.
14731
+ # @param key [String]
13346
14732
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13347
- # @return [Array<Hash>] Parsed JSON, shaped as `Array<JiraIssueLink>` — see
14733
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<JiraIssueType>` — see
13348
14734
  # `sig/infrawrench/sdk.rbs`.
13349
14735
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13350
- def links(org_id: nil, source_kind: nil, source_id: nil, request_options: nil)
14736
+ def issue_types(key:, org_id: nil, request_options: nil)
13351
14737
  @transport.request(
13352
14738
  http_method: "GET",
13353
- path: "/api/org/{orgId}/jira/links",
14739
+ path: "/api/org/{orgId}/jira/projects/{key}/issue-types",
14740
+ path_params: { "orgId" => org_id, "key" => key },
14741
+ request_options: request_options
14742
+ )
14743
+ end
14744
+
14745
+ # List Jira projects
14746
+ #
14747
+ # Backs the project picker, so nobody has to know a project key by hand.
14748
+ #
14749
+ # _Requires permission: `jira:read`._
14750
+ #
14751
+ # GET /api/org/{orgId}/jira/projects
14752
+ #
14753
+ # Raises on 400: Bad request
14754
+ #
14755
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14756
+ # constructed with.
14757
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14758
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<JiraProject>` — see
14759
+ # `sig/infrawrench/sdk.rbs`.
14760
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14761
+ def list(org_id: nil, request_options: nil)
14762
+ @transport.request(
14763
+ http_method: "GET",
14764
+ path: "/api/org/{orgId}/jira/projects",
13354
14765
  path_params: { "orgId" => org_id },
13355
- query: { "sourceKind" => source_kind, "sourceId" => source_id },
14766
+ request_options: request_options
14767
+ )
14768
+ end
14769
+ end
14770
+
14771
+ # `client.jira.webhook`
14772
+ class JiraWebhookNamespace
14773
+ # @api private
14774
+ # @param transport [Transport]
14775
+ def initialize(transport)
14776
+ @transport = transport
14777
+ end
14778
+
14779
+ # Set up the issue status webhook
14780
+ #
14781
+ # `auto` (the default) registers a webhook in Jira for `jira:issue_updated`
14782
+ # and `jira:issue_deleted` through the stored account, which Jira allows for
14783
+ # administrators only. When Jira refuses, the reply falls back to manual and
14784
+ # carries the URL and a one-time `secret` for an administrator to paste into
14785
+ # Jira's webhook form. `manual` skips the attempt. Replaces any webhook set
14786
+ # up before.
14787
+ #
14788
+ # _Requires permission: `jira:write`._
14789
+ #
14790
+ # POST /api/org/{orgId}/jira/webhook
14791
+ #
14792
+ # Raises on 400: Bad request
14793
+ #
14794
+ # Raises on 502: Jira refused or was unreachable
14795
+ #
14796
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14797
+ # constructed with.
14798
+ # @param body [Hash, nil] Request body, shaped as `JiraWebhookInput`.
14799
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14800
+ # @return [Hash] Parsed JSON, shaped as `IssueWebhookSetupResult` — see
14801
+ # `sig/infrawrench/sdk.rbs`.
14802
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14803
+ def create(org_id: nil, body: nil, request_options: nil)
14804
+ @transport.request(
14805
+ http_method: "POST",
14806
+ path: "/api/org/{orgId}/jira/webhook",
14807
+ path_params: { "orgId" => org_id },
14808
+ body: body,
14809
+ request_options: request_options
14810
+ )
14811
+ end
14812
+
14813
+ # Remove the issue status webhook
14814
+ #
14815
+ # Deletes the webhook in Jira when Infrawrench registered it. Statuses keep
14816
+ # refreshing through the poll.
14817
+ #
14818
+ # _Requires permission: `jira:write`._
14819
+ #
14820
+ # DELETE /api/org/{orgId}/jira/webhook
14821
+ #
14822
+ # Raises on 404: Not found
14823
+ #
14824
+ # Raises on 502: Jira refused or was unreachable
14825
+ #
14826
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14827
+ # constructed with.
14828
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14829
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
14830
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14831
+ def delete(org_id: nil, request_options: nil)
14832
+ @transport.request(
14833
+ http_method: "DELETE",
14834
+ path: "/api/org/{orgId}/jira/webhook",
14835
+ path_params: { "orgId" => org_id },
14836
+ request_options: request_options
14837
+ )
14838
+ end
14839
+ end
14840
+
14841
+ # `client.jira`
14842
+ class JiraNamespace
14843
+ # @return [JiraLinksNamespace] `client.jira.links`
14844
+ attr_reader :links
14845
+ # @return [JiraProjectsNamespace] `client.jira.projects`
14846
+ attr_reader :projects
14847
+ # @return [JiraWebhookNamespace] `client.jira.webhook`
14848
+ attr_reader :webhook
14849
+
14850
+ # @api private
14851
+ # @param transport [Transport]
14852
+ def initialize(transport)
14853
+ @transport = transport
14854
+ @links = JiraLinksNamespace.new(@transport)
14855
+ @projects = JiraProjectsNamespace.new(@transport)
14856
+ @webhook = JiraWebhookNamespace.new(@transport)
14857
+ end
14858
+
14859
+ # Disconnect Jira
14860
+ #
14861
+ # Issue links already recorded are kept, so filed findings stay marked as
14862
+ # filed.
14863
+ #
14864
+ # _Requires permission: `jira:write`._
14865
+ #
14866
+ # DELETE /api/org/{orgId}/jira
14867
+ #
14868
+ # Raises on 404: Not found
14869
+ #
14870
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14871
+ # constructed with.
14872
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14873
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
14874
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14875
+ def delete(org_id: nil, request_options: nil)
14876
+ @transport.request(
14877
+ http_method: "DELETE",
14878
+ path: "/api/org/{orgId}/jira",
14879
+ path_params: { "orgId" => org_id },
14880
+ request_options: request_options
14881
+ )
14882
+ end
14883
+
14884
+ # Get the org's Jira connection
14885
+ #
14886
+ # The stored API token is never returned; `tokenHint` stands in for it.
14887
+ #
14888
+ # _Requires permission: `jira:read`._
14889
+ #
14890
+ # GET /api/org/{orgId}/jira
14891
+ #
14892
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14893
+ # constructed with.
14894
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14895
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
14896
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14897
+ def get(org_id: nil, request_options: nil)
14898
+ @transport.request(
14899
+ http_method: "GET",
14900
+ path: "/api/org/{orgId}/jira",
14901
+ path_params: { "orgId" => org_id },
14902
+ request_options: request_options
14903
+ )
14904
+ end
14905
+
14906
+ # File a finding as a Jira issue
14907
+ #
14908
+ # Creates the issue, then records the link between it and the finding. The
14909
+ # link is what lets a list view show "already filed" instead of offering the
14910
+ # button again.
14911
+ #
14912
+ # _Requires permission: `jira:write`._
14913
+ #
14914
+ # POST /api/org/{orgId}/jira/issues
14915
+ #
14916
+ # Raises on 400: Bad request
14917
+ #
14918
+ # Raises on 502: Jira refused to create the issue, or was unreachable
14919
+ #
14920
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14921
+ # constructed with.
14922
+ # @param body [Hash] Request body, shaped as `CreateJiraIssueInput`.
14923
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14924
+ # @return [Hash] Parsed JSON, shaped as `CreateJiraIssueResult` — see
14925
+ # `sig/infrawrench/sdk.rbs`.
14926
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14927
+ def issues(body:, org_id: nil, request_options: nil)
14928
+ @transport.request(
14929
+ http_method: "POST",
14930
+ path: "/api/org/{orgId}/jira/issues",
14931
+ path_params: { "orgId" => org_id },
14932
+ body: body,
13356
14933
  request_options: request_options
13357
14934
  )
13358
14935
  end
@@ -13962,91 +15539,357 @@ module Infrawrench
13962
15539
  end
13963
15540
  end
13964
15541
 
13965
- # `client.kv`
13966
- class KvNamespace
15542
+ # `client.k8s_efficiency_reports`
15543
+ class K8sEfficiencyReportsNamespace
13967
15544
  # @api private
13968
15545
  # @param transport [Transport]
13969
15546
  def initialize(transport)
13970
15547
  @transport = transport
13971
15548
  end
13972
15549
 
13973
- # Run a Redis-style KV command
15550
+ # Create a Kubernetes efficiency report
13974
15551
  #
13975
- # _Requires permission: `resources:execute`._
15552
+ # _Requires permission: `costs:write`._
13976
15553
  #
13977
- # POST /api/org/{orgId}/kv/command
15554
+ # POST /api/org/{orgId}/k8s-efficiency-reports
13978
15555
  #
13979
15556
  # Raises on 400: Bad request
13980
15557
  #
13981
- # Raises on 404: Not found
13982
- #
13983
15558
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13984
15559
  # constructed with.
13985
- # @param body [Hash] Request body, shaped as `KvCommandRequest`.
15560
+ # @param body [Hash] Request body, shaped as `KubernetesEfficiencyReportInput`.
13986
15561
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13987
- # @return [Hash] Parsed JSON, shaped as `KvCommandResponse` — see `sig/infrawrench/sdk.rbs`.
15562
+ # @return [Hash] Parsed JSON, shaped as `KubernetesEfficiencyReport` — see
15563
+ # `sig/infrawrench/sdk.rbs`.
13988
15564
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13989
- def command(body:, org_id: nil, request_options: nil)
15565
+ def create(body:, org_id: nil, request_options: nil)
13990
15566
  @transport.request(
13991
15567
  http_method: "POST",
13992
- path: "/api/org/{orgId}/kv/command",
15568
+ path: "/api/org/{orgId}/k8s-efficiency-reports",
13993
15569
  path_params: { "orgId" => org_id },
13994
15570
  body: body,
13995
15571
  request_options: request_options
13996
15572
  )
13997
15573
  end
13998
- end
13999
15574
 
14000
- # `client.leaked_secrets`
14001
- class LeakedSecretsNamespace
14002
- # @api private
14003
- # @param transport [Transport]
14004
- def initialize(transport)
14005
- @transport = transport
15575
+ # Delete a Kubernetes efficiency report
15576
+ #
15577
+ # _Requires permission: `costs:write`._
15578
+ #
15579
+ # DELETE /api/org/{orgId}/k8s-efficiency-reports/{id}
15580
+ #
15581
+ # Raises on 404: Not found
15582
+ #
15583
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
15584
+ # constructed with.
15585
+ # @param id [String]
15586
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15587
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
15588
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
15589
+ def delete(id:, org_id: nil, request_options: nil)
15590
+ @transport.request(
15591
+ http_method: "DELETE",
15592
+ path: "/api/org/{orgId}/k8s-efficiency-reports/{id}",
15593
+ path_params: { "orgId" => org_id, "id" => id },
15594
+ request_options: request_options
15595
+ )
14006
15596
  end
14007
15597
 
14008
- # Dismiss a leaked credential
15598
+ # Export a Kubernetes efficiency report
14009
15599
  #
14010
- # Accept the finding as not a risk. Closes it upstream with the matching
14011
- # reason unless `resolveUpstream` is false.
15600
+ # One record per row and cost category plus the totals; with `perPeriod`,
15601
+ # each row's figures per period as well. CSV (RFC 4180) or newline-delimited
15602
+ # JSON.
14012
15603
  #
14013
- # _Requires permission: `secrets:write`._
15604
+ # _Requires permission: `costs:read`._
14014
15605
  #
14015
- # POST /api/org/{orgId}/leaked-secrets/{id}/dismiss
15606
+ # GET /api/org/{orgId}/k8s-efficiency-reports/{id}/export
14016
15607
  #
14017
15608
  # Raises on 400: Bad request
14018
15609
  #
14019
15610
  # Raises on 404: Not found
14020
15611
  #
14021
- # Raises on 409: Conflict
14022
- #
14023
15612
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14024
15613
  # constructed with.
14025
15614
  # @param id [String]
14026
- # @param body [Hash, nil] Request body, shaped as `LeakedSecretDismiss`.
15615
+ # @param format [String, nil]
15616
+ # @param per_period [String, nil]
14027
15617
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14028
- # @return [Hash] Parsed JSON, shaped as `LeakedSecretResponse` — see
14029
- # `sig/infrawrench/sdk.rbs`.
15618
+ # @return [String] Parsed JSON, shaped as `String` — see `sig/infrawrench/sdk.rbs`.
14030
15619
  # @raise [Infrawrench::ApiError] On any non-2xx response.
14031
- def dismiss(id:, org_id: nil, body: nil, request_options: nil)
15620
+ def export(id:, org_id: nil, format: nil, per_period: nil, request_options: nil)
14032
15621
  @transport.request(
14033
- http_method: "POST",
14034
- path: "/api/org/{orgId}/leaked-secrets/{id}/dismiss",
15622
+ http_method: "GET",
15623
+ path: "/api/org/{orgId}/k8s-efficiency-reports/{id}/export",
14035
15624
  path_params: { "orgId" => org_id, "id" => id },
14036
- body: body,
15625
+ query: { "format" => format, "perPeriod" => per_period },
14037
15626
  request_options: request_options
14038
15627
  )
14039
15628
  end
14040
15629
 
14041
- # List leaked credentials
15630
+ # Get a Kubernetes efficiency report
14042
15631
  #
14043
- # Secrets a scanner account (GitHub secret scanning, GitLab secret
14044
- # detection) found committed to code, attributed to the account or stored
14045
- # secret they belong to. Read from the last scan; no provider call is made.
15632
+ # _Requires permission: `costs:read`._
14046
15633
  #
14047
- # _Requires permission: `resources:read`._
15634
+ # GET /api/org/{orgId}/k8s-efficiency-reports/{id}
14048
15635
  #
14049
- # GET /api/org/{orgId}/leaked-secrets
15636
+ # Raises on 404: Not found
15637
+ #
15638
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
15639
+ # constructed with.
15640
+ # @param id [String]
15641
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15642
+ # @return [Hash] Parsed JSON, shaped as `KubernetesEfficiencyReport` — see
15643
+ # `sig/infrawrench/sdk.rbs`.
15644
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
15645
+ def get(id:, org_id: nil, request_options: nil)
15646
+ @transport.request(
15647
+ http_method: "GET",
15648
+ path: "/api/org/{orgId}/k8s-efficiency-reports/{id}",
15649
+ path_params: { "orgId" => org_id, "id" => id },
15650
+ request_options: request_options
15651
+ )
15652
+ end
15653
+
15654
+ # List Kubernetes efficiency reports
15655
+ #
15656
+ # The reports the caller's sharing lets them open, alphabetically.
15657
+ #
15658
+ # _Requires permission: `costs:read`._
15659
+ #
15660
+ # GET /api/org/{orgId}/k8s-efficiency-reports
15661
+ #
15662
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
15663
+ # constructed with.
15664
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15665
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<KubernetesEfficiencyReport>` — see
15666
+ # `sig/infrawrench/sdk.rbs`.
15667
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
15668
+ def list(org_id: nil, request_options: nil)
15669
+ @transport.request(
15670
+ http_method: "GET",
15671
+ path: "/api/org/{orgId}/k8s-efficiency-reports",
15672
+ path_params: { "orgId" => org_id },
15673
+ request_options: request_options
15674
+ )
15675
+ end
15676
+
15677
+ # Picker options for Kubernetes efficiency reports
15678
+ #
15679
+ # Clusters, regions, namespaces, node pools and label keys present on the
15680
+ # org's Kubernetes cost rows, narrowed to the caller's cost visibility
15681
+ # scope.
15682
+ #
15683
+ # _Requires permission: `costs:read`._
15684
+ #
15685
+ # GET /api/org/{orgId}/k8s-efficiency-reports/options
15686
+ #
15687
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
15688
+ # constructed with.
15689
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15690
+ # @return [Hash] Parsed JSON, shaped as `KubernetesEfficiencyOptions` — see
15691
+ # `sig/infrawrench/sdk.rbs`.
15692
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
15693
+ def options(org_id: nil, request_options: nil)
15694
+ @transport.request(
15695
+ http_method: "GET",
15696
+ path: "/api/org/{orgId}/k8s-efficiency-reports/options",
15697
+ path_params: { "orgId" => org_id },
15698
+ request_options: request_options
15699
+ )
15700
+ end
15701
+
15702
+ # Run an unsaved Kubernetes efficiency report config
15703
+ #
15704
+ # _Requires permission: `costs:read`._
15705
+ #
15706
+ # POST /api/org/{orgId}/k8s-efficiency-reports/query
15707
+ #
15708
+ # Raises on 400: Bad request
15709
+ #
15710
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
15711
+ # constructed with.
15712
+ # @param body [Hash] Request body, shaped as `Hash`.
15713
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15714
+ # @return [Hash] Parsed JSON, shaped as `KubernetesEfficiencyResult` — see
15715
+ # `sig/infrawrench/sdk.rbs`.
15716
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
15717
+ def query(body:, org_id: nil, request_options: nil)
15718
+ @transport.request(
15719
+ http_method: "POST",
15720
+ path: "/api/org/{orgId}/k8s-efficiency-reports/query",
15721
+ path_params: { "orgId" => org_id },
15722
+ body: body,
15723
+ request_options: request_options
15724
+ )
15725
+ end
15726
+
15727
+ # Run a Kubernetes efficiency report
15728
+ #
15729
+ # Per row and in total: total, used, requested-but-unused, unmeasured, idle
15730
+ # and overhead cost, efficiency on the report's basis, a per-category
15731
+ # breakdown and a per-period series.
15732
+ #
15733
+ # _Requires permission: `costs:read`._
15734
+ #
15735
+ # POST /api/org/{orgId}/k8s-efficiency-reports/{id}/run
15736
+ #
15737
+ # Raises on 404: Not found
15738
+ #
15739
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
15740
+ # constructed with.
15741
+ # @param id [String]
15742
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15743
+ # @return [Hash] Parsed JSON, shaped as `KubernetesEfficiencyRunResult` — see
15744
+ # `sig/infrawrench/sdk.rbs`.
15745
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
15746
+ def run(id:, org_id: nil, request_options: nil)
15747
+ @transport.request(
15748
+ http_method: "POST",
15749
+ path: "/api/org/{orgId}/k8s-efficiency-reports/{id}/run",
15750
+ path_params: { "orgId" => org_id, "id" => id },
15751
+ request_options: request_options
15752
+ )
15753
+ end
15754
+
15755
+ # Replace a Kubernetes efficiency report
15756
+ #
15757
+ # _Requires permission: `costs:write`._
15758
+ #
15759
+ # PUT /api/org/{orgId}/k8s-efficiency-reports/{id}
15760
+ #
15761
+ # Raises on 400: Bad request
15762
+ #
15763
+ # Raises on 404: Not found
15764
+ #
15765
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
15766
+ # constructed with.
15767
+ # @param id [String]
15768
+ # @param body [Hash] Request body, shaped as `KubernetesEfficiencyReportInput`.
15769
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15770
+ # @return [Hash] Parsed JSON, shaped as `KubernetesEfficiencyReport` — see
15771
+ # `sig/infrawrench/sdk.rbs`.
15772
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
15773
+ def update(id:, body:, org_id: nil, request_options: nil)
15774
+ @transport.request(
15775
+ http_method: "PUT",
15776
+ path: "/api/org/{orgId}/k8s-efficiency-reports/{id}",
15777
+ path_params: { "orgId" => org_id, "id" => id },
15778
+ body: body,
15779
+ request_options: request_options
15780
+ )
15781
+ end
15782
+
15783
+ # Values of one label on Kubernetes cost rows
15784
+ #
15785
+ # _Requires permission: `costs:read`._
15786
+ #
15787
+ # GET /api/org/{orgId}/k8s-efficiency-reports/values
15788
+ #
15789
+ # Raises on 400: Bad request
15790
+ #
15791
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
15792
+ # constructed with.
15793
+ # @param tag_key [String]
15794
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15795
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
15796
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
15797
+ def values(tag_key:, org_id: nil, request_options: nil)
15798
+ @transport.request(
15799
+ http_method: "GET",
15800
+ path: "/api/org/{orgId}/k8s-efficiency-reports/values",
15801
+ path_params: { "orgId" => org_id },
15802
+ query: { "tagKey" => tag_key },
15803
+ request_options: request_options
15804
+ )
15805
+ end
15806
+ end
15807
+
15808
+ # `client.kv`
15809
+ class KvNamespace
15810
+ # @api private
15811
+ # @param transport [Transport]
15812
+ def initialize(transport)
15813
+ @transport = transport
15814
+ end
15815
+
15816
+ # Run a Redis-style KV command
15817
+ #
15818
+ # _Requires permission: `resources:execute`._
15819
+ #
15820
+ # POST /api/org/{orgId}/kv/command
15821
+ #
15822
+ # Raises on 400: Bad request
15823
+ #
15824
+ # Raises on 404: Not found
15825
+ #
15826
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
15827
+ # constructed with.
15828
+ # @param body [Hash] Request body, shaped as `KvCommandRequest`.
15829
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15830
+ # @return [Hash] Parsed JSON, shaped as `KvCommandResponse` — see `sig/infrawrench/sdk.rbs`.
15831
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
15832
+ def command(body:, org_id: nil, request_options: nil)
15833
+ @transport.request(
15834
+ http_method: "POST",
15835
+ path: "/api/org/{orgId}/kv/command",
15836
+ path_params: { "orgId" => org_id },
15837
+ body: body,
15838
+ request_options: request_options
15839
+ )
15840
+ end
15841
+ end
15842
+
15843
+ # `client.leaked_secrets`
15844
+ class LeakedSecretsNamespace
15845
+ # @api private
15846
+ # @param transport [Transport]
15847
+ def initialize(transport)
15848
+ @transport = transport
15849
+ end
15850
+
15851
+ # Dismiss a leaked credential
15852
+ #
15853
+ # Accept the finding as not a risk. Closes it upstream with the matching
15854
+ # reason unless `resolveUpstream` is false.
15855
+ #
15856
+ # _Requires permission: `secrets:write`._
15857
+ #
15858
+ # POST /api/org/{orgId}/leaked-secrets/{id}/dismiss
15859
+ #
15860
+ # Raises on 400: Bad request
15861
+ #
15862
+ # Raises on 404: Not found
15863
+ #
15864
+ # Raises on 409: Conflict
15865
+ #
15866
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
15867
+ # constructed with.
15868
+ # @param id [String]
15869
+ # @param body [Hash, nil] Request body, shaped as `LeakedSecretDismiss`.
15870
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15871
+ # @return [Hash] Parsed JSON, shaped as `LeakedSecretResponse` — see
15872
+ # `sig/infrawrench/sdk.rbs`.
15873
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
15874
+ def dismiss(id:, org_id: nil, body: nil, request_options: nil)
15875
+ @transport.request(
15876
+ http_method: "POST",
15877
+ path: "/api/org/{orgId}/leaked-secrets/{id}/dismiss",
15878
+ path_params: { "orgId" => org_id, "id" => id },
15879
+ body: body,
15880
+ request_options: request_options
15881
+ )
15882
+ end
15883
+
15884
+ # List leaked credentials
15885
+ #
15886
+ # Secrets a scanner account (GitHub secret scanning, GitLab secret
15887
+ # detection) found committed to code, attributed to the account or stored
15888
+ # secret they belong to. Read from the last scan; no provider call is made.
15889
+ #
15890
+ # _Requires permission: `resources:read`._
15891
+ #
15892
+ # GET /api/org/{orgId}/leaked-secrets
14050
15893
  #
14051
15894
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14052
15895
  # constructed with.
@@ -14375,116 +16218,255 @@ module Infrawrench
14375
16218
  end
14376
16219
  end
14377
16220
 
14378
- # `client.linear`
14379
- class LinearNamespace
16221
+ # `client.linear.links`
16222
+ class LinearLinksNamespace
14380
16223
  # @api private
14381
16224
  # @param transport [Transport]
14382
16225
  def initialize(transport)
14383
16226
  @transport = transport
14384
16227
  end
14385
16228
 
14386
- # Disconnect Linear
14387
- #
14388
- # Issue links already recorded are kept, so filed findings stay marked as
14389
- # filed.
16229
+ # Look up filed issues for a set of findings
14390
16230
  #
14391
- # _Requires permission: `linear:write`._
16231
+ # _Requires permission: `linear:read`._
14392
16232
  #
14393
- # DELETE /api/org/{orgId}/linear
16233
+ # GET /api/org/{orgId}/linear/links
14394
16234
  #
14395
- # Raises on 404: Not found
16235
+ # Raises on 400: Bad request
14396
16236
  #
14397
16237
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14398
16238
  # constructed with.
16239
+ # @param source_kind [String, nil]
16240
+ # @param source_id [Array<String>, nil] Repeat to narrow to specific findings. Omit to
16241
+ # return every link of the kind; this is the batch lookup a list view makes once instead of
16242
+ # one request per row.
14399
16243
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14400
- # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
16244
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<LinearIssueLink>` — see
16245
+ # `sig/infrawrench/sdk.rbs`.
14401
16246
  # @raise [Infrawrench::ApiError] On any non-2xx response.
14402
- def delete(org_id: nil, request_options: nil)
16247
+ def list(org_id: nil, source_kind: nil, source_id: nil, request_options: nil)
14403
16248
  @transport.request(
14404
- http_method: "DELETE",
14405
- path: "/api/org/{orgId}/linear",
16249
+ http_method: "GET",
16250
+ path: "/api/org/{orgId}/linear/links",
14406
16251
  path_params: { "orgId" => org_id },
16252
+ query: { "sourceKind" => source_kind, "sourceId" => source_id },
14407
16253
  request_options: request_options
14408
16254
  )
14409
16255
  end
14410
16256
 
14411
- # Get the org's Linear connection
16257
+ # Refresh the status of filed Linear issues now
14412
16258
  #
14413
- # The stored API key is never returned; `keyHint` stands in for it.
16259
+ # Reads up to 200 of the org's filed issues from Linear (least recently
16260
+ # checked first) instead of waiting for a webhook or the poll.
14414
16261
  #
14415
16262
  # _Requires permission: `linear:read`._
14416
16263
  #
14417
- # GET /api/org/{orgId}/linear
16264
+ # POST /api/org/{orgId}/linear/links/refresh
16265
+ #
16266
+ # Raises on 400: Bad request
16267
+ #
16268
+ # Raises on 502: Linear refused or was unreachable
14418
16269
  #
14419
16270
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14420
16271
  # constructed with.
14421
16272
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14422
- # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
16273
+ # @return [Hash] Parsed JSON, shaped as `IssueStatusRefreshResult` — see
16274
+ # `sig/infrawrench/sdk.rbs`.
14423
16275
  # @raise [Infrawrench::ApiError] On any non-2xx response.
14424
- def get(org_id: nil, request_options: nil)
16276
+ def refresh(org_id: nil, request_options: nil)
14425
16277
  @transport.request(
14426
- http_method: "GET",
14427
- path: "/api/org/{orgId}/linear",
16278
+ http_method: "POST",
16279
+ path: "/api/org/{orgId}/linear/links/refresh",
14428
16280
  path_params: { "orgId" => org_id },
14429
16281
  request_options: request_options
14430
16282
  )
14431
16283
  end
16284
+ end
14432
16285
 
14433
- # File a finding as a Linear issue
16286
+ # `client.linear.webhook`
16287
+ class LinearWebhookNamespace
16288
+ # @api private
16289
+ # @param transport [Transport]
16290
+ def initialize(transport)
16291
+ @transport = transport
16292
+ end
16293
+
16294
+ # Set up the issue status webhook
14434
16295
  #
14435
- # Creates the issue via the issueCreate mutation, then records the link
14436
- # between it and the finding. The link is what lets a list view show
14437
- # "already filed" instead of offering the button again.
16296
+ # `auto` creates a webhook in Linear for `Issue` events on all public teams,
16297
+ # signed with a secret Infrawrench generates (Linear allows this for
16298
+ # workspace admins only). `manual` records a webhook somebody created in
16299
+ # Linear's settings at the URL from `POST /linear/webhook/url`, with the
16300
+ # signing secret Linear showed them. Replaces any webhook set up before.
14438
16301
  #
14439
16302
  # _Requires permission: `linear:write`._
14440
16303
  #
14441
- # POST /api/org/{orgId}/linear/issues
16304
+ # POST /api/org/{orgId}/linear/webhook
14442
16305
  #
14443
16306
  # Raises on 400: Bad request
14444
16307
  #
14445
- # Raises on 502: Linear refused to create the issue, or was unreachable
16308
+ # Raises on 502: Linear refused or was unreachable
14446
16309
  #
14447
16310
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14448
16311
  # constructed with.
14449
- # @param body [Hash] Request body, shaped as `CreateLinearIssueInput`.
16312
+ # @param body [Hash] Request body, shaped as `LinearWebhookInput`.
14450
16313
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14451
- # @return [Hash] Parsed JSON, shaped as `CreateLinearIssueResult` — see
16314
+ # @return [Hash] Parsed JSON, shaped as `IssueWebhookSetupResult` — see
14452
16315
  # `sig/infrawrench/sdk.rbs`.
14453
16316
  # @raise [Infrawrench::ApiError] On any non-2xx response.
14454
- def issues(body:, org_id: nil, request_options: nil)
16317
+ def create(body:, org_id: nil, request_options: nil)
14455
16318
  @transport.request(
14456
16319
  http_method: "POST",
14457
- path: "/api/org/{orgId}/linear/issues",
16320
+ path: "/api/org/{orgId}/linear/webhook",
14458
16321
  path_params: { "orgId" => org_id },
14459
16322
  body: body,
14460
16323
  request_options: request_options
14461
16324
  )
14462
16325
  end
14463
16326
 
14464
- # Look up filed issues for a set of findings
16327
+ # Remove the issue status webhook
16328
+ #
16329
+ # Deletes the webhook in Linear when Infrawrench created it. Statuses keep
16330
+ # refreshing through the poll.
16331
+ #
16332
+ # _Requires permission: `linear:write`._
16333
+ #
16334
+ # DELETE /api/org/{orgId}/linear/webhook
16335
+ #
16336
+ # Raises on 404: Not found
16337
+ #
16338
+ # Raises on 502: Linear refused or was unreachable
16339
+ #
16340
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
16341
+ # constructed with.
16342
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
16343
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
16344
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
16345
+ def delete(org_id: nil, request_options: nil)
16346
+ @transport.request(
16347
+ http_method: "DELETE",
16348
+ path: "/api/org/{orgId}/linear/webhook",
16349
+ path_params: { "orgId" => org_id },
16350
+ request_options: request_options
16351
+ )
16352
+ end
16353
+
16354
+ # Get the receiver URL for a hand-made Linear webhook
16355
+ #
16356
+ # Linear shows a webhook's signing secret only after it exists, so the URL
16357
+ # comes first; record the secret afterwards with `POST /linear/webhook` in
16358
+ # `manual` mode.
16359
+ #
16360
+ # _Requires permission: `linear:write`._
16361
+ #
16362
+ # POST /api/org/{orgId}/linear/webhook/url
16363
+ #
16364
+ # Raises on 400: Bad request
16365
+ #
16366
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
16367
+ # constructed with.
16368
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
16369
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
16370
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
16371
+ def url(org_id: nil, request_options: nil)
16372
+ @transport.request(
16373
+ http_method: "POST",
16374
+ path: "/api/org/{orgId}/linear/webhook/url",
16375
+ path_params: { "orgId" => org_id },
16376
+ request_options: request_options
16377
+ )
16378
+ end
16379
+ end
16380
+
16381
+ # `client.linear`
16382
+ class LinearNamespace
16383
+ # @return [LinearLinksNamespace] `client.linear.links`
16384
+ attr_reader :links
16385
+ # @return [LinearWebhookNamespace] `client.linear.webhook`
16386
+ attr_reader :webhook
16387
+
16388
+ # @api private
16389
+ # @param transport [Transport]
16390
+ def initialize(transport)
16391
+ @transport = transport
16392
+ @links = LinearLinksNamespace.new(@transport)
16393
+ @webhook = LinearWebhookNamespace.new(@transport)
16394
+ end
16395
+
16396
+ # Disconnect Linear
16397
+ #
16398
+ # Issue links already recorded are kept, so filed findings stay marked as
16399
+ # filed.
16400
+ #
16401
+ # _Requires permission: `linear:write`._
16402
+ #
16403
+ # DELETE /api/org/{orgId}/linear
16404
+ #
16405
+ # Raises on 404: Not found
16406
+ #
16407
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
16408
+ # constructed with.
16409
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
16410
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
16411
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
16412
+ def delete(org_id: nil, request_options: nil)
16413
+ @transport.request(
16414
+ http_method: "DELETE",
16415
+ path: "/api/org/{orgId}/linear",
16416
+ path_params: { "orgId" => org_id },
16417
+ request_options: request_options
16418
+ )
16419
+ end
16420
+
16421
+ # Get the org's Linear connection
16422
+ #
16423
+ # The stored API key is never returned; `keyHint` stands in for it.
14465
16424
  #
14466
16425
  # _Requires permission: `linear:read`._
14467
16426
  #
14468
- # GET /api/org/{orgId}/linear/links
16427
+ # GET /api/org/{orgId}/linear
16428
+ #
16429
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
16430
+ # constructed with.
16431
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
16432
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
16433
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
16434
+ def get(org_id: nil, request_options: nil)
16435
+ @transport.request(
16436
+ http_method: "GET",
16437
+ path: "/api/org/{orgId}/linear",
16438
+ path_params: { "orgId" => org_id },
16439
+ request_options: request_options
16440
+ )
16441
+ end
16442
+
16443
+ # File a finding as a Linear issue
16444
+ #
16445
+ # Creates the issue via the issueCreate mutation, then records the link
16446
+ # between it and the finding. The link is what lets a list view show
16447
+ # "already filed" instead of offering the button again.
16448
+ #
16449
+ # _Requires permission: `linear:write`._
16450
+ #
16451
+ # POST /api/org/{orgId}/linear/issues
14469
16452
  #
14470
16453
  # Raises on 400: Bad request
14471
16454
  #
16455
+ # Raises on 502: Linear refused to create the issue, or was unreachable
16456
+ #
14472
16457
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14473
16458
  # constructed with.
14474
- # @param source_kind [String, nil]
14475
- # @param source_id [Array<String>, nil] Repeat to narrow to specific findings. Omit to
14476
- # return every link of the kind; this is the batch lookup a list view makes once instead of
14477
- # one request per row.
16459
+ # @param body [Hash] Request body, shaped as `CreateLinearIssueInput`.
14478
16460
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14479
- # @return [Array<Hash>] Parsed JSON, shaped as `Array<LinearIssueLink>` — see
16461
+ # @return [Hash] Parsed JSON, shaped as `CreateLinearIssueResult` — see
14480
16462
  # `sig/infrawrench/sdk.rbs`.
14481
16463
  # @raise [Infrawrench::ApiError] On any non-2xx response.
14482
- def links(org_id: nil, source_kind: nil, source_id: nil, request_options: nil)
16464
+ def issues(body:, org_id: nil, request_options: nil)
14483
16465
  @transport.request(
14484
- http_method: "GET",
14485
- path: "/api/org/{orgId}/linear/links",
16466
+ http_method: "POST",
16467
+ path: "/api/org/{orgId}/linear/issues",
14486
16468
  path_params: { "orgId" => org_id },
14487
- query: { "sourceKind" => source_kind, "sourceId" => source_id },
16469
+ body: body,
14488
16470
  request_options: request_options
14489
16471
  )
14490
16472
  end
@@ -14730,12 +16712,83 @@ module Infrawrench
14730
16712
  end
14731
16713
  end
14732
16714
 
16715
+ # `client.managed_accounts.assignments`
16716
+ class ManagedAccountsAssignmentsNamespace
16717
+ # @api private
16718
+ # @param transport [Transport]
16719
+ def initialize(transport)
16720
+ @transport = transport
16721
+ end
16722
+
16723
+ # Assign cost centres and accounts to a customer in bulk
16724
+ #
16725
+ # Takes each item off whichever customer holds it and gives it to
16726
+ # `managedAccountId`, or to nobody when that is null, in one transaction.
16727
+ # Only drafts change: an approved invoice carries its own copy of its scope.
16728
+ #
16729
+ # _Requires permission: `invoices:write`._
16730
+ #
16731
+ # POST /api/org/{orgId}/managed-accounts/assignments
16732
+ #
16733
+ # Raises on 400: Bad request
16734
+ #
16735
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
16736
+ # constructed with.
16737
+ # @param body [Hash] Request body, shaped as `ManagedAccountAssignment`.
16738
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
16739
+ # @return [Hash] Parsed JSON, shaped as `ManagedAccountAssignmentResult` — see
16740
+ # `sig/infrawrench/sdk.rbs`.
16741
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
16742
+ def create(body:, org_id: nil, request_options: nil)
16743
+ @transport.request(
16744
+ http_method: "POST",
16745
+ path: "/api/org/{orgId}/managed-accounts/assignments",
16746
+ path_params: { "orgId" => org_id },
16747
+ body: body,
16748
+ request_options: request_options
16749
+ )
16750
+ end
16751
+
16752
+ # Preview a bulk assignment
16753
+ #
16754
+ # What moving these cost centres and accounts would do: who holds each one
16755
+ # today, the spend that moves with it in the period, the totals leaving each
16756
+ # customer, and how many draft invoices will change. Nothing is written.
16757
+ #
16758
+ # _Requires permission: `costs:read`._
16759
+ #
16760
+ # POST /api/org/{orgId}/managed-accounts/assignments/preview
16761
+ #
16762
+ # Raises on 400: Bad request
16763
+ #
16764
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
16765
+ # constructed with.
16766
+ # @param body [Hash] Request body, shaped as `ManagedAccountAssignmentPreviewRequest`.
16767
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
16768
+ # @return [Hash] Parsed JSON, shaped as `ManagedAccountAssignmentPreview` — see
16769
+ # `sig/infrawrench/sdk.rbs`.
16770
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
16771
+ def preview(body:, org_id: nil, request_options: nil)
16772
+ @transport.request(
16773
+ http_method: "POST",
16774
+ path: "/api/org/{orgId}/managed-accounts/assignments/preview",
16775
+ path_params: { "orgId" => org_id },
16776
+ body: body,
16777
+ request_options: request_options
16778
+ )
16779
+ end
16780
+ end
16781
+
14733
16782
  # `client.managed_accounts`
14734
16783
  class ManagedAccountsNamespace
16784
+ # @return [ManagedAccountsAssignmentsNamespace] `client.managed_accounts.assignments`
16785
+ attr_reader :assignments
16786
+
14735
16787
  # @api private
14736
16788
  # @param transport [Transport]
14737
16789
  def initialize(transport)
14738
16790
  @transport = transport
16791
+ @assignments = ManagedAccountsAssignmentsNamespace.new(@transport)
14739
16792
  end
14740
16793
 
14741
16794
  # Create a managed account
@@ -14845,6 +16898,36 @@ module Infrawrench
14845
16898
  )
14846
16899
  end
14847
16900
 
16901
+ # Find spend no customer is billed for
16902
+ #
16903
+ # Spend in the period, by cost centre and account, that no managed account's
16904
+ # scope covers. Requires `costs:read` as well as `invoices:read`: it is a
16905
+ # cost breakdown of the whole organisation.
16906
+ #
16907
+ # _Requires permission: `costs:read`._
16908
+ #
16909
+ # GET /api/org/{orgId}/managed-accounts/unassigned
16910
+ #
16911
+ # Raises on 400: Bad request
16912
+ #
16913
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
16914
+ # constructed with.
16915
+ # @param from [String, nil] Defaults, with `to`, to the last full calendar month.
16916
+ # @param to [String, nil]
16917
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
16918
+ # @return [Hash] Parsed JSON, shaped as `UnassignedSpendReport` — see
16919
+ # `sig/infrawrench/sdk.rbs`.
16920
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
16921
+ def unassigned(org_id: nil, from: nil, to: nil, request_options: nil)
16922
+ @transport.request(
16923
+ http_method: "GET",
16924
+ path: "/api/org/{orgId}/managed-accounts/unassigned",
16925
+ path_params: { "orgId" => org_id },
16926
+ query: { "from" => from, "to" => to },
16927
+ request_options: request_options
16928
+ )
16929
+ end
16930
+
14848
16931
  # Update a managed account
14849
16932
  #
14850
16933
  # A full replace. Editing the scope changes what **future** drafts are drawn
@@ -15416,60 +17499,217 @@ module Infrawrench
15416
17499
  end
15417
17500
  end
15418
17501
 
15419
- # `client.network_flows.settings`
15420
- class NetworkFlowsSettingsNamespace
17502
+ # `client.network_flows.reports`
17503
+ class NetworkFlowsReportsNamespace
15421
17504
  # @api private
15422
17505
  # @param transport [Transport]
15423
17506
  def initialize(transport)
15424
17507
  @transport = transport
15425
17508
  end
15426
17509
 
15427
- # Read the network flow collection switch
17510
+ # Create a network flow report
15428
17511
  #
15429
- # _Requires permission: `costs:read`._
17512
+ # _Requires permission: `costs:write`._
15430
17513
  #
15431
- # GET /api/org/{orgId}/network-flows/settings
17514
+ # POST /api/org/{orgId}/network-flows/reports
17515
+ #
17516
+ # Raises on 400: Bad request
17517
+ #
17518
+ # Raises on 403: Forbidden
15432
17519
  #
15433
17520
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
15434
17521
  # constructed with.
17522
+ # @param body [Hash] Request body, shaped as `NetworkFlowReportInput`.
15435
17523
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15436
- # @return [Hash] Parsed JSON, shaped as `NetworkFlowSettings` — see
15437
- # `sig/infrawrench/sdk.rbs`.
17524
+ # @return [Hash] Parsed JSON, shaped as `NetworkFlowReport` — see `sig/infrawrench/sdk.rbs`.
15438
17525
  # @raise [Infrawrench::ApiError] On any non-2xx response.
15439
- def get(org_id: nil, request_options: nil)
17526
+ def create(body:, org_id: nil, request_options: nil)
15440
17527
  @transport.request(
15441
- http_method: "GET",
15442
- path: "/api/org/{orgId}/network-flows/settings",
17528
+ http_method: "POST",
17529
+ path: "/api/org/{orgId}/network-flows/reports",
15443
17530
  path_params: { "orgId" => org_id },
17531
+ body: body,
15444
17532
  request_options: request_options
15445
17533
  )
15446
17534
  end
15447
17535
 
15448
- # Turn network flow collection on or off
15449
- #
15450
- # Collection is **off by default**. Enabling it authorizes Infrawrench to
15451
- # run daily queries against the provider's log store; and on AWS those
15452
- # queries are billed to your own cloud account per GB of log data scanned,
15453
- # every day, until you turn them off. That is why the write is governed by
15454
- # `org:settings:write` rather than `costs:write`, and why it is
15455
- # audit-logged.
15456
- #
15457
- # _Requires permission: `org:settings:write`._
17536
+ # Delete a network flow report
15458
17537
  #
15459
- # PUT /api/org/{orgId}/network-flows/settings
17538
+ # _Requires permission: `costs:write`._
15460
17539
  #
15461
- # Raises on 400: Bad request
17540
+ # DELETE /api/org/{orgId}/network-flows/reports/{id}
15462
17541
  #
15463
17542
  # Raises on 403: Forbidden
15464
17543
  #
15465
- # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
15466
- # constructed with.
15467
- # @param body [Hash] Request body, shaped as `NetworkFlowSettings`.
17544
+ # Raises on 404: Not found
17545
+ #
17546
+ # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
17547
+ # @param id [String]
15468
17548
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15469
- # @return [Hash] Parsed JSON, shaped as `NetworkFlowSettings` — see
15470
- # `sig/infrawrench/sdk.rbs`.
17549
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
15471
17550
  # @raise [Infrawrench::ApiError] On any non-2xx response.
15472
- def update(body:, org_id: nil, request_options: nil)
17551
+ def delete(id:, org_id: nil, request_options: nil)
17552
+ @transport.request(
17553
+ http_method: "DELETE",
17554
+ path: "/api/org/{orgId}/network-flows/reports/{id}",
17555
+ path_params: { "orgId" => org_id, "id" => id },
17556
+ request_options: request_options
17557
+ )
17558
+ end
17559
+
17560
+ # Get a network flow report
17561
+ #
17562
+ # _Requires permission: `costs:read`._
17563
+ #
17564
+ # GET /api/org/{orgId}/network-flows/reports/{id}
17565
+ #
17566
+ # Raises on 404: Not found
17567
+ #
17568
+ # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
17569
+ # @param id [String]
17570
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
17571
+ # @return [Hash] Parsed JSON, shaped as `NetworkFlowReport` — see `sig/infrawrench/sdk.rbs`.
17572
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
17573
+ def get(id:, org_id: nil, request_options: nil)
17574
+ @transport.request(
17575
+ http_method: "GET",
17576
+ path: "/api/org/{orgId}/network-flows/reports/{id}",
17577
+ path_params: { "orgId" => org_id, "id" => id },
17578
+ request_options: request_options
17579
+ )
17580
+ end
17581
+
17582
+ # List saved network flow reports
17583
+ #
17584
+ # _Requires permission: `costs:read`._
17585
+ #
17586
+ # GET /api/org/{orgId}/network-flows/reports
17587
+ #
17588
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
17589
+ # constructed with.
17590
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
17591
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<NetworkFlowReport>` — see
17592
+ # `sig/infrawrench/sdk.rbs`.
17593
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
17594
+ def list(org_id: nil, request_options: nil)
17595
+ @transport.request(
17596
+ http_method: "GET",
17597
+ path: "/api/org/{orgId}/network-flows/reports",
17598
+ path_params: { "orgId" => org_id },
17599
+ request_options: request_options
17600
+ )
17601
+ end
17602
+
17603
+ # Run a saved network flow report
17604
+ #
17605
+ # A relative date range resolves against today on every run.
17606
+ #
17607
+ # _Requires permission: `costs:read`._
17608
+ #
17609
+ # POST /api/org/{orgId}/network-flows/reports/{id}/run
17610
+ #
17611
+ # Raises on 400: Bad request
17612
+ #
17613
+ # Raises on 404: Not found
17614
+ #
17615
+ # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
17616
+ # @param id [String]
17617
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
17618
+ # @return [Hash] Parsed JSON, shaped as `NetworkFlowReportRunResult` — see
17619
+ # `sig/infrawrench/sdk.rbs`.
17620
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
17621
+ def run(id:, org_id: nil, request_options: nil)
17622
+ @transport.request(
17623
+ http_method: "POST",
17624
+ path: "/api/org/{orgId}/network-flows/reports/{id}/run",
17625
+ path_params: { "orgId" => org_id, "id" => id },
17626
+ request_options: request_options
17627
+ )
17628
+ end
17629
+
17630
+ # Replace a network flow report
17631
+ #
17632
+ # _Requires permission: `costs:write`._
17633
+ #
17634
+ # PUT /api/org/{orgId}/network-flows/reports/{id}
17635
+ #
17636
+ # Raises on 400: Bad request
17637
+ #
17638
+ # Raises on 403: Forbidden
17639
+ #
17640
+ # Raises on 404: Not found
17641
+ #
17642
+ # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
17643
+ # @param id [String]
17644
+ # @param body [Hash] Request body, shaped as `NetworkFlowReportInput`.
17645
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
17646
+ # @return [Hash] Parsed JSON, shaped as `NetworkFlowReport` — see `sig/infrawrench/sdk.rbs`.
17647
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
17648
+ def update(id:, body:, org_id: nil, request_options: nil)
17649
+ @transport.request(
17650
+ http_method: "PUT",
17651
+ path: "/api/org/{orgId}/network-flows/reports/{id}",
17652
+ path_params: { "orgId" => org_id, "id" => id },
17653
+ body: body,
17654
+ request_options: request_options
17655
+ )
17656
+ end
17657
+ end
17658
+
17659
+ # `client.network_flows.settings`
17660
+ class NetworkFlowsSettingsNamespace
17661
+ # @api private
17662
+ # @param transport [Transport]
17663
+ def initialize(transport)
17664
+ @transport = transport
17665
+ end
17666
+
17667
+ # Read the network flow collection switch
17668
+ #
17669
+ # _Requires permission: `costs:read`._
17670
+ #
17671
+ # GET /api/org/{orgId}/network-flows/settings
17672
+ #
17673
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
17674
+ # constructed with.
17675
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
17676
+ # @return [Hash] Parsed JSON, shaped as `NetworkFlowSettings` — see
17677
+ # `sig/infrawrench/sdk.rbs`.
17678
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
17679
+ def get(org_id: nil, request_options: nil)
17680
+ @transport.request(
17681
+ http_method: "GET",
17682
+ path: "/api/org/{orgId}/network-flows/settings",
17683
+ path_params: { "orgId" => org_id },
17684
+ request_options: request_options
17685
+ )
17686
+ end
17687
+
17688
+ # Turn network flow collection on or off
17689
+ #
17690
+ # Collection is **off by default**. Enabling it authorizes Infrawrench to
17691
+ # run daily queries against the provider's log store; and on AWS those
17692
+ # queries are billed to your own cloud account per GB of log data scanned,
17693
+ # every day, until you turn them off. That is why the write is governed by
17694
+ # `org:settings:write` rather than `costs:write`, and why it is
17695
+ # audit-logged.
17696
+ #
17697
+ # _Requires permission: `org:settings:write`._
17698
+ #
17699
+ # PUT /api/org/{orgId}/network-flows/settings
17700
+ #
17701
+ # Raises on 400: Bad request
17702
+ #
17703
+ # Raises on 403: Forbidden
17704
+ #
17705
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
17706
+ # constructed with.
17707
+ # @param body [Hash] Request body, shaped as `NetworkFlowSettings`.
17708
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
17709
+ # @return [Hash] Parsed JSON, shaped as `NetworkFlowSettings` — see
17710
+ # `sig/infrawrench/sdk.rbs`.
17711
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
17712
+ def update(body:, org_id: nil, request_options: nil)
15473
17713
  @transport.request(
15474
17714
  http_method: "PUT",
15475
17715
  path: "/api/org/{orgId}/network-flows/settings",
@@ -15484,6 +17724,8 @@ module Infrawrench
15484
17724
  class NetworkFlowsNamespace
15485
17725
  # @return [NetworkFlowsKubernetesNamespace] `client.network_flows.kubernetes`
15486
17726
  attr_reader :kubernetes
17727
+ # @return [NetworkFlowsReportsNamespace] `client.network_flows.reports`
17728
+ attr_reader :reports
15487
17729
  # @return [NetworkFlowsSettingsNamespace] `client.network_flows.settings`
15488
17730
  attr_reader :settings
15489
17731
 
@@ -15492,6 +17734,7 @@ module Infrawrench
15492
17734
  def initialize(transport)
15493
17735
  @transport = transport
15494
17736
  @kubernetes = NetworkFlowsKubernetesNamespace.new(@transport)
17737
+ @reports = NetworkFlowsReportsNamespace.new(@transport)
15495
17738
  @settings = NetworkFlowsSettingsNamespace.new(@transport)
15496
17739
  end
15497
17740
 
@@ -15553,6 +17796,59 @@ module Infrawrench
15553
17796
  request_options: request_options
15554
17797
  )
15555
17798
  end
17799
+
17800
+ # Picker values for the network flow report editor
17801
+ #
17802
+ # Accounts whose provider can report flows, and every VPC, region, zone,
17803
+ # peer service, peer resource type and endpoint seen in the store's 90-day
17804
+ # retention. Scoped to what the caller may see.
17805
+ #
17806
+ # _Requires permission: `costs:read`._
17807
+ #
17808
+ # GET /api/org/{orgId}/network-flows/report-options
17809
+ #
17810
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
17811
+ # constructed with.
17812
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
17813
+ # @return [Hash] Parsed JSON, shaped as `NetworkFlowReportOptions` — see
17814
+ # `sig/infrawrench/sdk.rbs`.
17815
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
17816
+ def report_options(org_id: nil, request_options: nil)
17817
+ @transport.request(
17818
+ http_method: "GET",
17819
+ path: "/api/org/{orgId}/network-flows/report-options",
17820
+ path_params: { "orgId" => org_id },
17821
+ request_options: request_options
17822
+ )
17823
+ end
17824
+
17825
+ # Run an unsaved network flow report config
17826
+ #
17827
+ # Bytes and estimated cost over time, per group, with the top talking pairs.
17828
+ # A read despite the method.
17829
+ #
17830
+ # _Requires permission: `costs:read`._
17831
+ #
17832
+ # POST /api/org/{orgId}/network-flows/report-query
17833
+ #
17834
+ # Raises on 400: Bad request
17835
+ #
17836
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
17837
+ # constructed with.
17838
+ # @param body [Hash] Request body, shaped as `NetworkFlowReportConfig`.
17839
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
17840
+ # @return [Hash] Parsed JSON, shaped as `NetworkFlowReportResult` — see
17841
+ # `sig/infrawrench/sdk.rbs`.
17842
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
17843
+ def report_query(body:, org_id: nil, request_options: nil)
17844
+ @transport.request(
17845
+ http_method: "POST",
17846
+ path: "/api/org/{orgId}/network-flows/report-query",
17847
+ path_params: { "orgId" => org_id },
17848
+ body: body,
17849
+ request_options: request_options
17850
+ )
17851
+ end
15556
17852
  end
15557
17853
 
15558
17854
  # `client.on_call.overrides`
@@ -15867,10 +18163,13 @@ module Infrawrench
15867
18163
  # Scans the organization's already-synced resources against each plugin's
15868
18164
  # declarative orphan heuristics (unattached volumes, unassigned
15869
18165
  # floating/elastic IPs, reserved-but-unused static IPs) and returns the
15870
- # matches grouped by account, each with the plugin's reason. Purely a read
15871
- # over stored state: no provider API calls are made, so results reflect the
15872
- # last sync. Where the org's collected cost data has per-resource rows,
15873
- # matches are annotated with trailing spend.
18166
+ # matches grouped by account, each with the plugin's reason. Rows flagged by
18167
+ # a metric-based idle rule (a NAT gateway with no traffic, a load balancer
18168
+ # with no requests) carry `idle` with the evidence; those verdicts come from
18169
+ # a daily collection, tuned under `/idle-findings`. Purely a read over
18170
+ # stored state: no provider API calls are made. Where the org's collected
18171
+ # cost data has per-resource rows, matches are annotated with trailing
18172
+ # spend; idle rows a plugin could price also carry a list-price `estimate`.
15874
18173
  #
15875
18174
  # _Requires permission: `resources:read`._
15876
18175
  #
@@ -18168,13 +20467,377 @@ module Infrawrench
18168
20467
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
18169
20468
  # constructed with.
18170
20469
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
18171
- # @return [Hash] Parsed JSON, shaped as `QuotaListResponse` — see `sig/infrawrench/sdk.rbs`.
20470
+ # @return [Hash] Parsed JSON, shaped as `QuotaListResponse` — see `sig/infrawrench/sdk.rbs`.
20471
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
20472
+ def get(org_id: nil, request_options: nil)
20473
+ @transport.request(
20474
+ http_method: "GET",
20475
+ path: "/api/org/{orgId}/quotas",
20476
+ path_params: { "orgId" => org_id },
20477
+ request_options: request_options
20478
+ )
20479
+ end
20480
+ end
20481
+
20482
+ # `client.resource_reports.csv`
20483
+ class ResourceReportsCsvNamespace
20484
+ # @api private
20485
+ # @param transport [Transport]
20486
+ def initialize(transport)
20487
+ @transport = transport
20488
+ end
20489
+
20490
+ # Export an unsaved resource report config as CSV
20491
+ #
20492
+ # Every matching row up to 50,000, with tag and cost columns (one numeric
20493
+ # column per cost column and currency). A cut file ends with a `# Truncated`
20494
+ # line.
20495
+ #
20496
+ # _Requires permission: `resources:read`._
20497
+ #
20498
+ # POST /api/org/{orgId}/resource-reports/csv
20499
+ #
20500
+ # Raises on 400: Bad request
20501
+ #
20502
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
20503
+ # constructed with.
20504
+ # @param body [Hash, nil] Request body, shaped as `Hash`.
20505
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
20506
+ # @return [String] Raw response bytes.
20507
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
20508
+ def create(org_id: nil, body: nil, request_options: nil)
20509
+ @transport.request(
20510
+ http_method: "POST",
20511
+ path: "/api/org/{orgId}/resource-reports/csv",
20512
+ path_params: { "orgId" => org_id },
20513
+ body: body,
20514
+ accept: :binary,
20515
+ request_options: request_options
20516
+ )
20517
+ end
20518
+
20519
+ # Export a saved resource report as CSV
20520
+ #
20521
+ # Every matching row up to 50,000; a cut file ends with a `# Truncated`
20522
+ # line.
20523
+ #
20524
+ # _Requires permission: `resources:read`._
20525
+ #
20526
+ # GET /api/org/{orgId}/resource-reports/{id}/csv
20527
+ #
20528
+ # Raises on 400: Bad request
20529
+ #
20530
+ # Raises on 404: Not found
20531
+ #
20532
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
20533
+ # constructed with.
20534
+ # @param id [String]
20535
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
20536
+ # @return [String] Raw response bytes.
20537
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
20538
+ def get(id:, org_id: nil, request_options: nil)
20539
+ @transport.request(
20540
+ http_method: "GET",
20541
+ path: "/api/org/{orgId}/resource-reports/{id}/csv",
20542
+ path_params: { "orgId" => org_id, "id" => id },
20543
+ accept: :binary,
20544
+ request_options: request_options
20545
+ )
20546
+ end
20547
+ end
20548
+
20549
+ # `client.resource_reports`
20550
+ class ResourceReportsNamespace
20551
+ # @return [ResourceReportsCsvNamespace] `client.resource_reports.csv`
20552
+ attr_reader :csv
20553
+
20554
+ # @api private
20555
+ # @param transport [Transport]
20556
+ def initialize(transport)
20557
+ @transport = transport
20558
+ @csv = ResourceReportsCsvNamespace.new(@transport)
20559
+ end
20560
+
20561
+ # Create a resource report
20562
+ #
20563
+ # The creator is the report's implicit owner for sharing. Filing it in a
20564
+ # folder needs editor access to the folder. Audit-logged.
20565
+ #
20566
+ # _Requires permission: `resources:write`._
20567
+ #
20568
+ # POST /api/org/{orgId}/resource-reports
20569
+ #
20570
+ # Raises on 400: Bad request
20571
+ #
20572
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
20573
+ # constructed with.
20574
+ # @param body [Hash, nil] Request body, shaped as `ResourceReportInput`.
20575
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
20576
+ # @return [Hash] Parsed JSON, shaped as `ResourceReport` — see `sig/infrawrench/sdk.rbs`.
20577
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
20578
+ def create(org_id: nil, body: nil, request_options: nil)
20579
+ @transport.request(
20580
+ http_method: "POST",
20581
+ path: "/api/org/{orgId}/resource-reports",
20582
+ path_params: { "orgId" => org_id },
20583
+ body: body,
20584
+ request_options: request_options
20585
+ )
20586
+ end
20587
+
20588
+ # Delete a resource report
20589
+ #
20590
+ # Soft delete; its sharing goes with it. Audit-logged.
20591
+ #
20592
+ # _Requires permission: `resources:write`._
20593
+ #
20594
+ # DELETE /api/org/{orgId}/resource-reports/{id}
20595
+ #
20596
+ # Raises on 404: Not found
20597
+ #
20598
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
20599
+ # constructed with.
20600
+ # @param id [String]
20601
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
20602
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
20603
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
20604
+ def delete(id:, org_id: nil, request_options: nil)
20605
+ @transport.request(
20606
+ http_method: "DELETE",
20607
+ path: "/api/org/{orgId}/resource-reports/{id}",
20608
+ path_params: { "orgId" => org_id, "id" => id },
20609
+ request_options: request_options
20610
+ )
20611
+ end
20612
+
20613
+ # List report folders for resource reports
20614
+ #
20615
+ # The report folders the caller can see. Resource reports share the folder
20616
+ # tree cost reports use; create and rename folders through
20617
+ # `/cost-report-folders`.
20618
+ #
20619
+ # _Requires permission: `resources:read`._
20620
+ #
20621
+ # GET /api/org/{orgId}/resource-reports/folders
20622
+ #
20623
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
20624
+ # constructed with.
20625
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
20626
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<CostReportFolder>` — see
20627
+ # `sig/infrawrench/sdk.rbs`.
20628
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
20629
+ def folders(org_id: nil, request_options: nil)
20630
+ @transport.request(
20631
+ http_method: "GET",
20632
+ path: "/api/org/{orgId}/resource-reports/folders",
20633
+ path_params: { "orgId" => org_id },
20634
+ request_options: request_options
20635
+ )
20636
+ end
20637
+
20638
+ # Read a resource report
20639
+ #
20640
+ # _Requires permission: `resources:read`._
20641
+ #
20642
+ # GET /api/org/{orgId}/resource-reports/{id}
20643
+ #
20644
+ # Raises on 404: Not found
20645
+ #
20646
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
20647
+ # constructed with.
20648
+ # @param id [String]
20649
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
20650
+ # @return [Hash] Parsed JSON, shaped as `ResourceReport` — see `sig/infrawrench/sdk.rbs`.
20651
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
20652
+ def get(id:, org_id: nil, request_options: nil)
20653
+ @transport.request(
20654
+ http_method: "GET",
20655
+ path: "/api/org/{orgId}/resource-reports/{id}",
20656
+ path_params: { "orgId" => org_id, "id" => id },
20657
+ request_options: request_options
20658
+ )
20659
+ end
20660
+
20661
+ # List resource reports
20662
+ #
20663
+ # The saved inventory reports the caller's sharing lets them open, by name.
20664
+ #
20665
+ # _Requires permission: `resources:read`._
20666
+ #
20667
+ # GET /api/org/{orgId}/resource-reports
20668
+ #
20669
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
20670
+ # constructed with.
20671
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
20672
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<ResourceReport>` — see
20673
+ # `sig/infrawrench/sdk.rbs`.
20674
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
20675
+ def list(org_id: nil, request_options: nil)
20676
+ @transport.request(
20677
+ http_method: "GET",
20678
+ path: "/api/org/{orgId}/resource-reports",
20679
+ path_params: { "orgId" => org_id },
20680
+ request_options: request_options
20681
+ )
20682
+ end
20683
+
20684
+ # What a resource report can filter and show
20685
+ #
20686
+ # Providers, accounts, resource types, regions and statuses with resource
20687
+ # counts, the metadata fields the given types expose (from the type
20688
+ # definitions and the newest synced resources), provider tag keys and, with
20689
+ # `costs:read`, virtual tag keys.
20690
+ #
20691
+ # _Requires permission: `resources:read`._
20692
+ #
20693
+ # GET /api/org/{orgId}/resource-reports/options
20694
+ #
20695
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
20696
+ # constructed with.
20697
+ # @param types [String, nil] Comma-separated `pluginId/resourceTypeId` pairs narrowing
20698
+ # `fields`.
20699
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
20700
+ # @return [Hash] Parsed JSON, shaped as `ResourceReportOptions` — see
20701
+ # `sig/infrawrench/sdk.rbs`.
20702
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
20703
+ def options(org_id: nil, types: nil, request_options: nil)
20704
+ @transport.request(
20705
+ http_method: "GET",
20706
+ path: "/api/org/{orgId}/resource-reports/options",
20707
+ path_params: { "orgId" => org_id },
20708
+ query: { "types" => types },
20709
+ request_options: request_options
20710
+ )
20711
+ end
20712
+
20713
+ # Run an unsaved resource report config
20714
+ #
20715
+ # A read despite the method. Returns one page of rows. Cost and virtual tag
20716
+ # cells need `costs:read` and respect the caller's cost visibility scope.
20717
+ #
20718
+ # _Requires permission: `resources:read`._
20719
+ #
20720
+ # POST /api/org/{orgId}/resource-reports/query
20721
+ #
20722
+ # Raises on 400: Bad request
20723
+ #
20724
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
20725
+ # constructed with.
20726
+ # @param body [Hash, nil] Request body, shaped as `ResourceReportQueryRequest`.
20727
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
20728
+ # @return [Hash] Parsed JSON, shaped as `ResourceReportRows` — see
20729
+ # `sig/infrawrench/sdk.rbs`.
20730
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
20731
+ def query(org_id: nil, body: nil, request_options: nil)
20732
+ @transport.request(
20733
+ http_method: "POST",
20734
+ path: "/api/org/{orgId}/resource-reports/query",
20735
+ path_params: { "orgId" => org_id },
20736
+ body: body,
20737
+ request_options: request_options
20738
+ )
20739
+ end
20740
+
20741
+ # Run a saved resource report
20742
+ #
20743
+ # One page of rows. `sort` and `direction` override the saved sort for this
20744
+ # request only.
20745
+ #
20746
+ # _Requires permission: `resources:read`._
20747
+ #
20748
+ # GET /api/org/{orgId}/resource-reports/{id}/rows
20749
+ #
20750
+ # Raises on 400: Bad request
20751
+ #
20752
+ # Raises on 404: Not found
20753
+ #
20754
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
20755
+ # constructed with.
20756
+ # @param id [String]
20757
+ # @param offset [Integer, nil, nil]
20758
+ # @param limit [Integer, nil]
20759
+ # @param sort [String, nil] `<kind>:<key>`.
20760
+ # `core:name|type|provider|account|region|status|created|external_id`; `field:<key>` a key
20761
+ # of the resource's synced fields (offered by `GET /resource-reports/options`); `tag:<key>`
20762
+ # a provider tag; `vtag:<key>` a virtual tag, read from the resource's own cost rows over
20763
+ # `costRange` (the value holding the most spend); `cost:range|mtd|previous_month` spend
20764
+ # joined by provider resource id.
20765
+ # @param direction [String, nil]
20766
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
20767
+ # @return [Hash] Parsed JSON, shaped as `ResourceReportRows` — see
20768
+ # `sig/infrawrench/sdk.rbs`.
20769
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
20770
+ def rows(
20771
+ id:,
20772
+ org_id: nil,
20773
+ offset: nil,
20774
+ limit: nil,
20775
+ sort: nil,
20776
+ direction: nil,
20777
+ request_options: nil
20778
+ )
20779
+ @transport.request(
20780
+ http_method: "GET",
20781
+ path: "/api/org/{orgId}/resource-reports/{id}/rows",
20782
+ path_params: { "orgId" => org_id, "id" => id },
20783
+ query: { "offset" => offset, "limit" => limit, "sort" => sort, "direction" => direction },
20784
+ request_options: request_options
20785
+ )
20786
+ end
20787
+
20788
+ # Values one tag key takes
20789
+ #
20790
+ # Provider tag values from synced resources, or virtual tag values from
20791
+ # spend (empty without `costs:read`), most common first.
20792
+ #
20793
+ # _Requires permission: `resources:read`._
20794
+ #
20795
+ # GET /api/org/{orgId}/resource-reports/tag-values
20796
+ #
20797
+ # Raises on 400: Bad request
20798
+ #
20799
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
20800
+ # constructed with.
20801
+ # @param source [String, nil]
20802
+ # @param key [String]
20803
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
20804
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
20805
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
20806
+ def tag_values(key:, org_id: nil, source: nil, request_options: nil)
20807
+ @transport.request(
20808
+ http_method: "GET",
20809
+ path: "/api/org/{orgId}/resource-reports/tag-values",
20810
+ path_params: { "orgId" => org_id },
20811
+ query: { "source" => source, "key" => key },
20812
+ request_options: request_options
20813
+ )
20814
+ end
20815
+
20816
+ # Replace a resource report
20817
+ #
20818
+ # Name, description, config and folder together. Needs editor. Audit-logged.
20819
+ #
20820
+ # _Requires permission: `resources:write`._
20821
+ #
20822
+ # PUT /api/org/{orgId}/resource-reports/{id}
20823
+ #
20824
+ # Raises on 400: Bad request
20825
+ #
20826
+ # Raises on 404: Not found
20827
+ #
20828
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
20829
+ # constructed with.
20830
+ # @param id [String]
20831
+ # @param body [Hash, nil] Request body, shaped as `ResourceReportInput`.
20832
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
20833
+ # @return [Hash] Parsed JSON, shaped as `ResourceReport` — see `sig/infrawrench/sdk.rbs`.
18172
20834
  # @raise [Infrawrench::ApiError] On any non-2xx response.
18173
- def get(org_id: nil, request_options: nil)
20835
+ def update(id:, org_id: nil, body: nil, request_options: nil)
18174
20836
  @transport.request(
18175
- http_method: "GET",
18176
- path: "/api/org/{orgId}/quotas",
18177
- path_params: { "orgId" => org_id },
20837
+ http_method: "PUT",
20838
+ path: "/api/org/{orgId}/resource-reports/{id}",
20839
+ path_params: { "orgId" => org_id, "id" => id },
20840
+ body: body,
18178
20841
  request_options: request_options
18179
20842
  )
18180
20843
  end
@@ -19747,6 +22410,125 @@ module Infrawrench
19747
22410
  end
19748
22411
  end
19749
22412
 
22413
+ # `client.savings.findings`
22414
+ class SavingsFindingsNamespace
22415
+ # @api private
22416
+ # @param transport [Transport]
22417
+ def initialize(transport)
22418
+ @transport = transport
22419
+ end
22420
+
22421
+ # List savings findings
22422
+ #
22423
+ # Every savings finder's findings (orphaned and idle resources, oversized
22424
+ # resources, extended support surcharges, unused SaaS seats) with a
22425
+ # lifecycle status, a detected date and summary tiles. Open findings that a
22426
+ # scan stops reporting move to Completed automatically (`resolution:
22427
+ # resolved`); a finding that returns after that reopens as Ready with a new
22428
+ # detected date. A cost-scoped caller sees only findings on accounts granted
22429
+ # to them outright.
22430
+ #
22431
+ # _Requires permission: `resources:read`._
22432
+ #
22433
+ # GET /api/org/{orgId}/savings/findings
22434
+ #
22435
+ # Raises on 400: Bad request
22436
+ #
22437
+ # Raises on 404: Not found
22438
+ #
22439
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
22440
+ # constructed with.
22441
+ # @param view [String, nil] Apply a saved view, by id or name. Explicit params override it.
22442
+ # @param status [String, nil] A status, `open` (Ready or In progress), or `all`.
22443
+ # @param kind [String, nil] Comma-separated finding kinds.
22444
+ # @param provider [String, nil] Comma-separated plugin ids.
22445
+ # @param account [String, nil] Comma-separated account ids.
22446
+ # @param region [String, nil] Comma-separated regions.
22447
+ # @param tag [String, nil] `key` or `key=value`; repeat for more terms (all must match).
22448
+ # @param min_savings [String, nil] Minimum monthly savings, in each finding's own currency.
22449
+ # Unpriced findings never pass.
22450
+ # @param detected_from [String, nil] Detected on or after (UTC day).
22451
+ # @param detected_to [String, nil] Detected on or before (UTC day).
22452
+ # @param q [String, nil] Case-insensitive text match over title, resource and account.
22453
+ # @param sort [String, nil] `<field>:<asc|desc>`; fields savings, detected, name,
22454
+ # status_changed.
22455
+ # @param refresh [String, nil] `true` bypasses the right-sizing and extended support caches.
22456
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
22457
+ # @return [Hash] Parsed JSON, shaped as `SavingsFindingsResponse` — see
22458
+ # `sig/infrawrench/sdk.rbs`.
22459
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
22460
+ def get(
22461
+ org_id: nil,
22462
+ view: nil,
22463
+ status: nil,
22464
+ kind: nil,
22465
+ provider: nil,
22466
+ account: nil,
22467
+ region: nil,
22468
+ tag: nil,
22469
+ min_savings: nil,
22470
+ detected_from: nil,
22471
+ detected_to: nil,
22472
+ q: nil,
22473
+ sort: nil,
22474
+ refresh: nil,
22475
+ request_options: nil
22476
+ )
22477
+ @transport.request(
22478
+ http_method: "GET",
22479
+ path: "/api/org/{orgId}/savings/findings",
22480
+ path_params: { "orgId" => org_id },
22481
+ query: {
22482
+ "view" => view,
22483
+ "status" => status,
22484
+ "kind" => kind,
22485
+ "provider" => provider,
22486
+ "account" => account,
22487
+ "region" => region,
22488
+ "tag" => tag,
22489
+ "minSavings" => min_savings,
22490
+ "detectedFrom" => detected_from,
22491
+ "detectedTo" => detected_to,
22492
+ "q" => q,
22493
+ "sort" => sort,
22494
+ "refresh" => refresh
22495
+ },
22496
+ request_options: request_options
22497
+ )
22498
+ end
22499
+
22500
+ # Change savings finding status
22501
+ #
22502
+ # Moves findings to a status, recording who, when and an optional note;
22503
+ # Completed by hand records `resolution: manual`. Audited per finding and
22504
+ # published as the `savings.finding.status_changed` event. Keys the caller
22505
+ # cannot see come back in `missing`; a 404 when none matched.
22506
+ #
22507
+ # _Requires permission: `resources:write`._
22508
+ #
22509
+ # POST /api/org/{orgId}/savings/findings/status
22510
+ #
22511
+ # Raises on 400: Bad request
22512
+ #
22513
+ # Raises on 404: Not found
22514
+ #
22515
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
22516
+ # constructed with.
22517
+ # @param body [Hash] Request body, shaped as `SavingsFindingStatusInput`.
22518
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
22519
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
22520
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
22521
+ def status(body:, org_id: nil, request_options: nil)
22522
+ @transport.request(
22523
+ http_method: "POST",
22524
+ path: "/api/org/{orgId}/savings/findings/status",
22525
+ path_params: { "orgId" => org_id },
22526
+ body: body,
22527
+ request_options: request_options
22528
+ )
22529
+ end
22530
+ end
22531
+
19750
22532
  # `client.savings.settings`
19751
22533
  class SavingsSettingsNamespace
19752
22534
  # @api private
@@ -19807,6 +22589,8 @@ module Infrawrench
19807
22589
  class SavingsNamespace
19808
22590
  # @return [SavingsEventsNamespace] `client.savings.events`
19809
22591
  attr_reader :events
22592
+ # @return [SavingsFindingsNamespace] `client.savings.findings`
22593
+ attr_reader :findings
19810
22594
  # @return [SavingsSettingsNamespace] `client.savings.settings`
19811
22595
  attr_reader :settings
19812
22596
 
@@ -19815,6 +22599,7 @@ module Infrawrench
19815
22599
  def initialize(transport)
19816
22600
  @transport = transport
19817
22601
  @events = SavingsEventsNamespace.new(@transport)
22602
+ @findings = SavingsFindingsNamespace.new(@transport)
19818
22603
  @settings = SavingsSettingsNamespace.new(@transport)
19819
22604
  end
19820
22605
 
@@ -19850,6 +22635,151 @@ module Infrawrench
19850
22635
  end
19851
22636
  end
19852
22637
 
22638
+ # `client.savings_views`
22639
+ class SavingsViewsNamespace
22640
+ # @api private
22641
+ # @param transport [Transport]
22642
+ def initialize(transport)
22643
+ @transport = transport
22644
+ end
22645
+
22646
+ # Create a savings view
22647
+ #
22648
+ # Names are unique per organization, case-insensitively.
22649
+ #
22650
+ # _Requires permission: `resources:write`._
22651
+ #
22652
+ # POST /api/org/{orgId}/savings-views
22653
+ #
22654
+ # Raises on 400: Bad request
22655
+ #
22656
+ # Raises on 409: A live savings view already uses this name.
22657
+ #
22658
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
22659
+ # constructed with.
22660
+ # @param body [Hash] Request body, shaped as `SavingsViewInput`.
22661
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
22662
+ # @return [Hash] Parsed JSON, shaped as `SavingsView` — see `sig/infrawrench/sdk.rbs`.
22663
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
22664
+ def create(body:, org_id: nil, request_options: nil)
22665
+ @transport.request(
22666
+ http_method: "POST",
22667
+ path: "/api/org/{orgId}/savings-views",
22668
+ path_params: { "orgId" => org_id },
22669
+ body: body,
22670
+ request_options: request_options
22671
+ )
22672
+ end
22673
+
22674
+ # Delete a savings view
22675
+ #
22676
+ # Soft delete. Needs owner on the view (or editor when nobody owns it).
22677
+ #
22678
+ # _Requires permission: `resources:write`._
22679
+ #
22680
+ # DELETE /api/org/{orgId}/savings-views/{id}
22681
+ #
22682
+ # Raises on 403: Forbidden
22683
+ #
22684
+ # Raises on 404: Not found
22685
+ #
22686
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
22687
+ # constructed with.
22688
+ # @param id [String]
22689
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
22690
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
22691
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
22692
+ def delete(id:, org_id: nil, request_options: nil)
22693
+ @transport.request(
22694
+ http_method: "DELETE",
22695
+ path: "/api/org/{orgId}/savings-views/{id}",
22696
+ path_params: { "orgId" => org_id, "id" => id },
22697
+ request_options: request_options
22698
+ )
22699
+ end
22700
+
22701
+ # Get a savings view
22702
+ #
22703
+ # _Requires permission: `resources:read`._
22704
+ #
22705
+ # GET /api/org/{orgId}/savings-views/{id}
22706
+ #
22707
+ # Raises on 404: Not found
22708
+ #
22709
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
22710
+ # constructed with.
22711
+ # @param id [String]
22712
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
22713
+ # @return [Hash] Parsed JSON, shaped as `SavingsView` — see `sig/infrawrench/sdk.rbs`.
22714
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
22715
+ def get(id:, org_id: nil, request_options: nil)
22716
+ @transport.request(
22717
+ http_method: "GET",
22718
+ path: "/api/org/{orgId}/savings-views/{id}",
22719
+ path_params: { "orgId" => org_id, "id" => id },
22720
+ request_options: request_options
22721
+ )
22722
+ end
22723
+
22724
+ # List savings views
22725
+ #
22726
+ # Saved views over the savings findings list: a status tab, a filter and a
22727
+ # sort. Narrowed by per-object sharing (`savings_view`); the creator owns a
22728
+ # view.
22729
+ #
22730
+ # _Requires permission: `resources:read`._
22731
+ #
22732
+ # GET /api/org/{orgId}/savings-views
22733
+ #
22734
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
22735
+ # constructed with.
22736
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
22737
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<SavingsView>` — see
22738
+ # `sig/infrawrench/sdk.rbs`.
22739
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
22740
+ def list(org_id: nil, request_options: nil)
22741
+ @transport.request(
22742
+ http_method: "GET",
22743
+ path: "/api/org/{orgId}/savings-views",
22744
+ path_params: { "orgId" => org_id },
22745
+ request_options: request_options
22746
+ )
22747
+ end
22748
+
22749
+ # Update a savings view
22750
+ #
22751
+ # Full replace. Needs editor on the view.
22752
+ #
22753
+ # _Requires permission: `resources:write`._
22754
+ #
22755
+ # PUT /api/org/{orgId}/savings-views/{id}
22756
+ #
22757
+ # Raises on 400: Bad request
22758
+ #
22759
+ # Raises on 403: Forbidden
22760
+ #
22761
+ # Raises on 404: Not found
22762
+ #
22763
+ # Raises on 409: A live savings view already uses this name.
22764
+ #
22765
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
22766
+ # constructed with.
22767
+ # @param id [String]
22768
+ # @param body [Hash] Request body, shaped as `SavingsViewInput`.
22769
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
22770
+ # @return [Hash] Parsed JSON, shaped as `SavingsView` — see `sig/infrawrench/sdk.rbs`.
22771
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
22772
+ def update(id:, body:, org_id: nil, request_options: nil)
22773
+ @transport.request(
22774
+ http_method: "PUT",
22775
+ path: "/api/org/{orgId}/savings-views/{id}",
22776
+ path_params: { "orgId" => org_id, "id" => id },
22777
+ body: body,
22778
+ request_options: request_options
22779
+ )
22780
+ end
22781
+ end
22782
+
19853
22783
  # `client.schedules`
19854
22784
  class SchedulesNamespace
19855
22785
  # @api private
@@ -20287,25 +23217,41 @@ module Infrawrench
20287
23217
  @transport = transport
20288
23218
  end
20289
23219
 
20290
- # Search resources (capped at 50 hits) and workflows across the org
23220
+ # Search resources, workflows and (with `kinds`) saved objects across the
23221
+ # org
23222
+ #
23223
+ # Without `kinds`: resources (capped at 50, substring match over name,
23224
+ # account, provider and type) and workflows; requires `resources:read`. With
23225
+ # `kinds`: the command palette's index. Each named kind the caller's role
23226
+ # can read is searched (a kind it cannot read is skipped, not refused),
23227
+ # narrowed to the objects the caller could open (per-object sharing for cost
23228
+ # reports, folders, dashboards and canvases; cost visibility for budgets),
23229
+ # and fuzzy-ranked: every whitespace-separated token must match the name or
23230
+ # a supporting label, as a substring or an in-order subsequence. At most 8
23231
+ # hits per saved-object kind and 50 resources; kinds are ordered by their
23232
+ # best hit.
20291
23233
  #
20292
23234
  # _Requires permission: `resources:read`._
20293
23235
  #
20294
23236
  # GET /api/org/{orgId}/search
20295
23237
  #
23238
+ # Raises on 400: Bad request
23239
+ #
20296
23240
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
20297
23241
  # constructed with.
20298
23242
  # @param q [String, nil]
23243
+ # @param kinds [String, nil] `all`, or a comma-separated list of `SearchResultKind` values.
23244
+ # An unknown kind is a 400.
20299
23245
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
20300
23246
  # @return [Array<Hash>] Parsed JSON, shaped as `Array<SearchHit>` — see
20301
23247
  # `sig/infrawrench/sdk.rbs`.
20302
23248
  # @raise [Infrawrench::ApiError] On any non-2xx response.
20303
- def list(org_id: nil, q: nil, request_options: nil)
23249
+ def list(org_id: nil, q: nil, kinds: nil, request_options: nil)
20304
23250
  @transport.request(
20305
23251
  http_method: "GET",
20306
23252
  path: "/api/org/{orgId}/search",
20307
23253
  path_params: { "orgId" => org_id },
20308
- query: { "q" => q },
23254
+ query: { "q" => q, "kinds" => kinds },
20309
23255
  request_options: request_options
20310
23256
  )
20311
23257
  end
@@ -22657,6 +25603,92 @@ module Infrawrench
22657
25603
  end
22658
25604
  end
22659
25605
 
25606
+ # `client.starred`
25607
+ class StarredNamespace
25608
+ # @api private
25609
+ # @param transport [Transport]
25610
+ def initialize(transport)
25611
+ @transport = transport
25612
+ end
25613
+
25614
+ # Unstar an object
25615
+ #
25616
+ # Idempotent, and allowed on objects the caller can no longer see.
25617
+ #
25618
+ # DELETE /api/org/{orgId}/starred/{kind}/{objectId}
25619
+ #
25620
+ # Raises on 400: Bad request
25621
+ #
25622
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
25623
+ # constructed with.
25624
+ # @param kind [String]
25625
+ # @param object_id [String]
25626
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
25627
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
25628
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
25629
+ def delete(kind:, object_id:, org_id: nil, request_options: nil)
25630
+ @transport.request(
25631
+ http_method: "DELETE",
25632
+ path: "/api/org/{orgId}/starred/{kind}/{objectId}",
25633
+ path_params: { "orgId" => org_id, "kind" => kind, "objectId" => object_id },
25634
+ request_options: request_options
25635
+ )
25636
+ end
25637
+
25638
+ # List the caller's starred items
25639
+ #
25640
+ # The caller's own stars in this org, most recently starred first, each
25641
+ # resolved fresh to the same shape as a search hit. Stars on objects the
25642
+ # caller can no longer open (deleted, unshared, outside their cost
25643
+ # visibility, or of a kind their role cannot read) are left out rather than
25644
+ # deleted, so they come back if access does.
25645
+ #
25646
+ # GET /api/org/{orgId}/starred
25647
+ #
25648
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
25649
+ # constructed with.
25650
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
25651
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
25652
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
25653
+ def get(org_id: nil, request_options: nil)
25654
+ @transport.request(
25655
+ http_method: "GET",
25656
+ path: "/api/org/{orgId}/starred",
25657
+ path_params: { "orgId" => org_id },
25658
+ request_options: request_options
25659
+ )
25660
+ end
25661
+
25662
+ # Star an object
25663
+ #
25664
+ # Idempotent. The object must be one the caller could open; anything else is
25665
+ # a 404. A member can star up to 200 items per org (409 beyond that).
25666
+ #
25667
+ # PUT /api/org/{orgId}/starred/{kind}/{objectId}
25668
+ #
25669
+ # Raises on 400: Bad request
25670
+ #
25671
+ # Raises on 404: Not found
25672
+ #
25673
+ # Raises on 409: Conflict
25674
+ #
25675
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
25676
+ # constructed with.
25677
+ # @param kind [String]
25678
+ # @param object_id [String]
25679
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
25680
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
25681
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
25682
+ def update(kind:, object_id:, org_id: nil, request_options: nil)
25683
+ @transport.request(
25684
+ http_method: "PUT",
25685
+ path: "/api/org/{orgId}/starred/{kind}/{objectId}",
25686
+ path_params: { "orgId" => org_id, "kind" => kind, "objectId" => object_id },
25687
+ request_options: request_options
25688
+ )
25689
+ end
25690
+ end
25691
+
22660
25692
  # `client.status`
22661
25693
  class StatusNamespace
22662
25694
  # @api private
@@ -23566,10 +26598,10 @@ module Infrawrench
23566
26598
 
23567
26599
  # Delete a virtual tag
23568
26600
  #
23569
- # Refused with a 409 that names every saved filter, budget, report,
23570
- # dashboard card, change alert, allocation rule, cost export or business
23571
- # metric still referencing the key: deleting it would make those fail rather
23572
- # than quietly widen to all spend.
26601
+ # Refused with a 409 that names every other virtual tag, saved filter,
26602
+ # budget, report, dashboard card, change alert, allocation rule, cost export
26603
+ # or business metric still referencing the key: deleting it would make those
26604
+ # fail rather than quietly widen to all spend.
23573
26605
  #
23574
26606
  # _Requires permission: `costs:write`._
23575
26607
  #
@@ -24445,6 +27477,8 @@ module Infrawrench
24445
27477
  attr_reader :bastions
24446
27478
  # @return [BillingNamespace] `client.billing`
24447
27479
  attr_reader :billing
27480
+ # @return [BillingProfilesNamespace] `client.billing_profiles`
27481
+ attr_reader :billing_profiles
24448
27482
  # @return [BillingRulesNamespace] `client.billing_rules`
24449
27483
  attr_reader :billing_rules
24450
27484
  # @return [BlastRadiusNamespace] `client.blast_radius`
@@ -24481,6 +27515,8 @@ module Infrawrench
24481
27515
  attr_reader :cost_centres
24482
27516
  # @return [CostExportsNamespace] `client.cost_exports`
24483
27517
  attr_reader :cost_exports
27518
+ # @return [CostReportAnomalyAlertsNamespace] `client.cost_report_anomaly_alerts`
27519
+ attr_reader :cost_report_anomaly_alerts
24484
27520
  # @return [CostReportFoldersNamespace] `client.cost_report_folders`
24485
27521
  attr_reader :cost_report_folders
24486
27522
  # @return [CostReportNotificationsNamespace] `client.cost_report_notifications`
@@ -24533,16 +27569,22 @@ module Infrawrench
24533
27569
  attr_reader :github_issues
24534
27570
  # @return [IacNamespace] `client.iac`
24535
27571
  attr_reader :iac
27572
+ # @return [IdleFindingsNamespace] `client.idle_findings`
27573
+ attr_reader :idle_findings
24536
27574
  # @return [IncidentsNamespace] `client.incidents`
24537
27575
  attr_reader :incidents
24538
27576
  # @return [InvitationsNamespace] `client.invitations`
24539
27577
  attr_reader :invitations
24540
27578
  # @return [InvoicesNamespace] `client.invoices`
24541
27579
  attr_reader :invoices
27580
+ # @return [IssueWebhooksNamespace] `client.issue_webhooks`
27581
+ attr_reader :issue_webhooks
24542
27582
  # @return [JiraNamespace] `client.jira`
24543
27583
  attr_reader :jira
24544
27584
  # @return [JitAccessNamespace] `client.jit_access`
24545
27585
  attr_reader :jit_access
27586
+ # @return [K8sEfficiencyReportsNamespace] `client.k8s_efficiency_reports`
27587
+ attr_reader :k8s_efficiency_reports
24546
27588
  # @return [KvNamespace] `client.kv`
24547
27589
  attr_reader :kv
24548
27590
  # @return [LeakedSecretsNamespace] `client.leaked_secrets`
@@ -24595,6 +27637,8 @@ module Infrawrench
24595
27637
  attr_reader :query_monitors
24596
27638
  # @return [QuotasNamespace] `client.quotas`
24597
27639
  attr_reader :quotas
27640
+ # @return [ResourceReportsNamespace] `client.resource_reports`
27641
+ attr_reader :resource_reports
24598
27642
  # @return [ResourcesNamespace] `client.resources`
24599
27643
  attr_reader :resources
24600
27644
  # @return [RightsizingNamespace] `client.rightsizing`
@@ -24605,6 +27649,8 @@ module Infrawrench
24605
27649
  attr_reader :saved_cost_filters
24606
27650
  # @return [SavingsNamespace] `client.savings`
24607
27651
  attr_reader :savings
27652
+ # @return [SavingsViewsNamespace] `client.savings_views`
27653
+ attr_reader :savings_views
24608
27654
  # @return [SchedulesNamespace] `client.schedules`
24609
27655
  attr_reader :schedules
24610
27656
  # @return [ScorecardsNamespace] `client.scorecards`
@@ -24635,6 +27681,8 @@ module Infrawrench
24635
27681
  attr_reader :ssh_keys
24636
27682
  # @return [SshTunnelsNamespace] `client.ssh_tunnels`
24637
27683
  attr_reader :ssh_tunnels
27684
+ # @return [StarredNamespace] `client.starred`
27685
+ attr_reader :starred
24638
27686
  # @return [StatusNamespace] `client.status`
24639
27687
  attr_reader :status
24640
27688
  # @return [StatusIncidentsNamespace] `client.status_incidents`
@@ -24685,6 +27733,7 @@ module Infrawrench
24685
27733
  @backups = BackupsNamespace.new(@transport)
24686
27734
  @bastions = BastionsNamespace.new(@transport)
24687
27735
  @billing = BillingNamespace.new(@transport)
27736
+ @billing_profiles = BillingProfilesNamespace.new(@transport)
24688
27737
  @billing_rules = BillingRulesNamespace.new(@transport)
24689
27738
  @blast_radius = BlastRadiusNamespace.new(@transport)
24690
27739
  @budgets = BudgetsNamespace.new(@transport)
@@ -24703,6 +27752,7 @@ module Infrawrench
24703
27752
  @cost_canvases = CostCanvasesNamespace.new(@transport)
24704
27753
  @cost_centres = CostCentresNamespace.new(@transport)
24705
27754
  @cost_exports = CostExportsNamespace.new(@transport)
27755
+ @cost_report_anomaly_alerts = CostReportAnomalyAlertsNamespace.new(@transport)
24706
27756
  @cost_report_folders = CostReportFoldersNamespace.new(@transport)
24707
27757
  @cost_report_notifications = CostReportNotificationsNamespace.new(@transport)
24708
27758
  @cost_reports = CostReportsNamespace.new(@transport)
@@ -24729,11 +27779,14 @@ module Infrawrench
24729
27779
  @extended_support = ExtendedSupportNamespace.new(@transport)
24730
27780
  @github_issues = GithubIssuesNamespace.new(@transport)
24731
27781
  @iac = IacNamespace.new(@transport)
27782
+ @idle_findings = IdleFindingsNamespace.new(@transport)
24732
27783
  @incidents = IncidentsNamespace.new(@transport)
24733
27784
  @invitations = InvitationsNamespace.new(@transport)
24734
27785
  @invoices = InvoicesNamespace.new(@transport)
27786
+ @issue_webhooks = IssueWebhooksNamespace.new(@transport)
24735
27787
  @jira = JiraNamespace.new(@transport)
24736
27788
  @jit_access = JitAccessNamespace.new(@transport)
27789
+ @k8s_efficiency_reports = K8sEfficiencyReportsNamespace.new(@transport)
24737
27790
  @kv = KvNamespace.new(@transport)
24738
27791
  @leaked_secrets = LeakedSecretsNamespace.new(@transport)
24739
27792
  @leases = LeasesNamespace.new(@transport)
@@ -24760,11 +27813,13 @@ module Infrawrench
24760
27813
  @provider_oauth = ProviderOauthNamespace.new(@transport)
24761
27814
  @query_monitors = QueryMonitorsNamespace.new(@transport)
24762
27815
  @quotas = QuotasNamespace.new(@transport)
27816
+ @resource_reports = ResourceReportsNamespace.new(@transport)
24763
27817
  @resources = ResourcesNamespace.new(@transport)
24764
27818
  @rightsizing = RightsizingNamespace.new(@transport)
24765
27819
  @runbooks = RunbooksNamespace.new(@transport)
24766
27820
  @saved_cost_filters = SavedCostFiltersNamespace.new(@transport)
24767
27821
  @savings = SavingsNamespace.new(@transport)
27822
+ @savings_views = SavingsViewsNamespace.new(@transport)
24768
27823
  @schedules = SchedulesNamespace.new(@transport)
24769
27824
  @scorecards = ScorecardsNamespace.new(@transport)
24770
27825
  @search = SearchNamespace.new(@transport)
@@ -24780,6 +27835,7 @@ module Infrawrench
24780
27835
  @ssh_fanout = SshFanoutNamespace.new(@transport)
24781
27836
  @ssh_keys = SshKeysNamespace.new(@transport)
24782
27837
  @ssh_tunnels = SshTunnelsNamespace.new(@transport)
27838
+ @starred = StarredNamespace.new(@transport)
24783
27839
  @status = StatusNamespace.new(@transport)
24784
27840
  @status_incidents = StatusIncidentsNamespace.new(@transport)
24785
27841
  @status_pages = StatusPagesNamespace.new(@transport)