infrawrench-sdk 1.75.0 → 1.77.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.75.0 | MIT | Copyright (c) 2026 Infrawrench LLC
3
+ # infrawrench-sdk v1.77.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.75.0).
6
+ # Generated from the Infrawrench API OpenAPI 3.1 spec (API version 1.77.0).
7
7
  #
8
8
  # DO NOT EDIT. Regenerate with:
9
9
  # pnpm --filter @infrawrench/web generate:sdk
@@ -12408,198 +12408,255 @@ module Infrawrench
12408
12408
  end
12409
12409
  end
12410
12410
 
12411
- # `client.kv`
12412
- class KvNamespace
12411
+ # `client.jit_access.accounts`
12412
+ class JitAccessAccountsNamespace
12413
12413
  # @api private
12414
12414
  # @param transport [Transport]
12415
12415
  def initialize(transport)
12416
12416
  @transport = transport
12417
12417
  end
12418
12418
 
12419
- # Run a Redis-style KV command
12420
- #
12421
- # _Requires permission: `resources:execute`._
12419
+ # Accounts that can grant just-in-time access
12422
12420
  #
12423
- # POST /api/org/{orgId}/kv/command
12421
+ # Connected accounts whose provider plugin declares the just-in-time
12422
+ # capability.
12424
12423
  #
12425
- # Raises on 400: Bad request
12424
+ # _Requires permission: `access:read`._
12426
12425
  #
12427
- # Raises on 404: Not found
12426
+ # GET /api/org/{orgId}/jit-access/accounts
12428
12427
  #
12429
12428
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12430
12429
  # constructed with.
12431
- # @param body [Hash] Request body, shaped as `KvCommandRequest`.
12432
12430
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12433
- # @return [Hash] Parsed JSON, shaped as `KvCommandResponse` — see `sig/infrawrench/sdk.rbs`.
12431
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<JitAccessAccount>` — see
12432
+ # `sig/infrawrench/sdk.rbs`.
12434
12433
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12435
- def command(body:, org_id: nil, request_options: nil)
12434
+ def list(org_id: nil, request_options: nil)
12436
12435
  @transport.request(
12437
- http_method: "POST",
12438
- path: "/api/org/{orgId}/kv/command",
12436
+ http_method: "GET",
12437
+ path: "/api/org/{orgId}/jit-access/accounts",
12439
12438
  path_params: { "orgId" => org_id },
12440
- body: body,
12441
12439
  request_options: request_options
12442
12440
  )
12443
12441
  end
12444
- end
12445
12442
 
12446
- # `client.leases`
12447
- class LeasesNamespace
12448
- # @api private
12449
- # @param transport [Transport]
12450
- def initialize(transport)
12451
- @transport = transport
12443
+ # Grantable roles in a scope (picker)
12444
+ #
12445
+ # _Requires permission: `org:settings:write`._
12446
+ #
12447
+ # GET /api/org/{orgId}/jit-access/accounts/{accountId}/roles
12448
+ #
12449
+ # Raises on 502: Provider error
12450
+ #
12451
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12452
+ # constructed with.
12453
+ # @param account_id [String]
12454
+ # @param scope_id [String]
12455
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12456
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<JitPickerOption>` — see
12457
+ # `sig/infrawrench/sdk.rbs`.
12458
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
12459
+ def roles(account_id:, scope_id:, org_id: nil, request_options: nil)
12460
+ @transport.request(
12461
+ http_method: "GET",
12462
+ path: "/api/org/{orgId}/jit-access/accounts/{accountId}/roles",
12463
+ path_params: { "orgId" => org_id, "accountId" => account_id },
12464
+ query: { "scopeId" => scope_id },
12465
+ request_options: request_options
12466
+ )
12452
12467
  end
12453
12468
 
12454
- # Cancel a lease
12455
- #
12456
- # Stop the countdown; the resource stays, the lease goes `canceled` and
12457
- # leaves the expiry radar. Audit-logged.
12469
+ # Scopes on an account (picker)
12458
12470
  #
12459
- # _Requires permission: `resources:write`._
12471
+ # The places a role can be granted (AWS accounts, GCP projects, namespaces),
12472
+ # read from the provider.
12460
12473
  #
12461
- # POST /api/org/{orgId}/leases/{leaseId}/cancel
12474
+ # _Requires permission: `org:settings:write`._
12462
12475
  #
12463
- # Raises on 400: Bad request
12476
+ # GET /api/org/{orgId}/jit-access/accounts/{accountId}/scopes
12464
12477
  #
12465
- # Raises on 404: Not found
12478
+ # Raises on 502: Provider error
12466
12479
  #
12467
12480
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12468
12481
  # constructed with.
12469
- # @param lease_id [String]
12482
+ # @param account_id [String]
12470
12483
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12471
- # @return [Hash] Parsed JSON, shaped as `ResourceLease` — see `sig/infrawrench/sdk.rbs`.
12484
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<JitPickerOption>` — see
12485
+ # `sig/infrawrench/sdk.rbs`.
12472
12486
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12473
- def cancel(lease_id:, org_id: nil, request_options: nil)
12487
+ def scopes(account_id:, org_id: nil, request_options: nil)
12474
12488
  @transport.request(
12475
- http_method: "POST",
12476
- path: "/api/org/{orgId}/leases/{leaseId}/cancel",
12477
- path_params: { "orgId" => org_id, "leaseId" => lease_id },
12489
+ http_method: "GET",
12490
+ path: "/api/org/{orgId}/jit-access/accounts/{accountId}/scopes",
12491
+ path_params: { "orgId" => org_id, "accountId" => account_id },
12478
12492
  request_options: request_options
12479
12493
  )
12480
12494
  end
12495
+ end
12481
12496
 
12482
- # Create a resource lease
12497
+ # `client.jit_access.policies`
12498
+ class JitAccessPoliciesNamespace
12499
+ # @api private
12500
+ # @param transport [Transport]
12501
+ def initialize(transport)
12502
+ @transport = transport
12503
+ end
12504
+
12505
+ # Create a policy
12483
12506
  #
12484
- # Attach an expiry to a resource; 'give me a test cluster for 3 days'. One
12485
- # lease per resource (an active lease conflicts; a terminal one is
12486
- # replaced). `autoDelete: true` opts into deletion at expiry; the poller
12487
- # announces it twice first, defers during change freezes, and requires the
12488
- # caller to hold `resources:delete`. Audit-logged.
12507
+ # Audit-logged. At least one approver (member, role or on-call rotation) is
12508
+ # required.
12489
12509
  #
12490
- # _Requires permission: `resources:write`._
12510
+ # _Requires permission: `org:settings:write`._
12491
12511
  #
12492
- # POST /api/org/{orgId}/leases
12512
+ # POST /api/org/{orgId}/jit-access/policies
12493
12513
  #
12494
12514
  # Raises on 400: Bad request
12495
12515
  #
12496
- # Raises on 404: Not found
12497
- #
12498
- # Raises on 409: The resource already has an active lease
12499
- #
12500
12516
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12501
12517
  # constructed with.
12502
- # @param body [Hash, nil] Request body, shaped as `ResourceLeaseCreate`.
12518
+ # @param body [Hash, nil] Request body, shaped as `JitPolicyInput`.
12503
12519
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12504
- # @return [Hash] Parsed JSON, shaped as `ResourceLease` — see `sig/infrawrench/sdk.rbs`.
12520
+ # @return [Hash] Parsed JSON, shaped as `JitPolicy` — see `sig/infrawrench/sdk.rbs`.
12505
12521
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12506
12522
  def create(org_id: nil, body: nil, request_options: nil)
12507
12523
  @transport.request(
12508
12524
  http_method: "POST",
12509
- path: "/api/org/{orgId}/leases",
12525
+ path: "/api/org/{orgId}/jit-access/policies",
12510
12526
  path_params: { "orgId" => org_id },
12511
12527
  body: body,
12512
12528
  request_options: request_options
12513
12529
  )
12514
12530
  end
12515
12531
 
12516
- # Delete a lease row
12532
+ # Delete a policy
12517
12533
  #
12518
- # Remove the lease record entirely (including terminal rows). The resource
12519
- # is not touched. Audit-logged.
12534
+ # Grants the policy produced still end on time; its pending requests have no
12535
+ # approvers and time out.
12520
12536
  #
12521
- # _Requires permission: `resources:write`._
12537
+ # _Requires permission: `org:settings:write`._
12522
12538
  #
12523
- # DELETE /api/org/{orgId}/leases/{leaseId}
12539
+ # DELETE /api/org/{orgId}/jit-access/policies/{policyId}
12524
12540
  #
12525
12541
  # Raises on 404: Not found
12526
12542
  #
12527
12543
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12528
12544
  # constructed with.
12529
- # @param lease_id [String]
12545
+ # @param policy_id [String]
12530
12546
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12531
- # @return [nil] This endpoint returns no content.
12547
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
12532
12548
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12533
- def delete(lease_id:, org_id: nil, request_options: nil)
12549
+ def delete(policy_id:, org_id: nil, request_options: nil)
12534
12550
  @transport.request(
12535
12551
  http_method: "DELETE",
12536
- path: "/api/org/{orgId}/leases/{leaseId}",
12537
- path_params: { "orgId" => org_id, "leaseId" => lease_id },
12538
- accept: :empty,
12552
+ path: "/api/org/{orgId}/jit-access/policies/{policyId}",
12553
+ path_params: { "orgId" => org_id, "policyId" => policy_id },
12539
12554
  request_options: request_options
12540
12555
  )
12541
12556
  end
12542
12557
 
12543
- # List resource leases
12558
+ # Get a policy
12544
12559
  #
12545
- # Every lease in the organization, soonest deadline first. Active leases
12546
- # also appear on the expiry radar (`GET /expiring`) as kind `lease` items,
12547
- # so the owner is nagged through the existing expiry alerts.
12560
+ # _Requires permission: `access:read`._
12548
12561
  #
12549
- # _Requires permission: `resources:read`._
12562
+ # GET /api/org/{orgId}/jit-access/policies/{policyId}
12550
12563
  #
12551
- # GET /api/org/{orgId}/leases
12564
+ # Raises on 404: Not found
12552
12565
  #
12553
12566
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12554
12567
  # constructed with.
12568
+ # @param policy_id [String]
12555
12569
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12556
- # @return [Hash] Parsed JSON, shaped as `ResourceLeaseList` — see `sig/infrawrench/sdk.rbs`.
12570
+ # @return [Hash] Parsed JSON, shaped as `JitPolicy` — see `sig/infrawrench/sdk.rbs`.
12557
12571
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12558
- def get(org_id: nil, request_options: nil)
12572
+ def get(policy_id:, org_id: nil, request_options: nil)
12559
12573
  @transport.request(
12560
12574
  http_method: "GET",
12561
- path: "/api/org/{orgId}/leases",
12575
+ path: "/api/org/{orgId}/jit-access/policies/{policyId}",
12576
+ path_params: { "orgId" => org_id, "policyId" => policy_id },
12577
+ request_options: request_options
12578
+ )
12579
+ end
12580
+
12581
+ # List just-in-time access policies
12582
+ #
12583
+ # _Requires permission: `access:read`._
12584
+ #
12585
+ # GET /api/org/{orgId}/jit-access/policies
12586
+ #
12587
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12588
+ # constructed with.
12589
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12590
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<JitPolicy>` — see
12591
+ # `sig/infrawrench/sdk.rbs`.
12592
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
12593
+ def list(org_id: nil, request_options: nil)
12594
+ @transport.request(
12595
+ http_method: "GET",
12596
+ path: "/api/org/{orgId}/jit-access/policies",
12562
12597
  path_params: { "orgId" => org_id },
12563
12598
  request_options: request_options
12564
12599
  )
12565
12600
  end
12566
12601
 
12567
- # Get one resource's lease
12602
+ # Resolve the caller's provider principal
12568
12603
  #
12569
- # The (unique) lease on a resource, whatever its status, or null.
12604
+ # Who the grant would go to, matched by the caller's email in the provider.
12570
12605
  #
12571
- # _Requires permission: `resources:read`._
12606
+ # _Requires permission: `access:request`._
12572
12607
  #
12573
- # GET /api/org/{orgId}/leases/resource
12608
+ # GET /api/org/{orgId}/jit-access/policies/{policyId}/principal
12574
12609
  #
12575
- # Raises on 400: Bad request
12610
+ # Raises on 403: Not a requester
12576
12611
  #
12577
12612
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12578
12613
  # constructed with.
12579
- # @param resource_id [String]
12614
+ # @param policy_id [String]
12580
12615
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12581
- # @return [Hash] Parsed JSON, shaped as `ResourceLeaseLookup` — see
12616
+ # @return [Hash] Parsed JSON, shaped as `JitPrincipalResolution` — see
12582
12617
  # `sig/infrawrench/sdk.rbs`.
12583
12618
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12584
- def resource(resource_id:, org_id: nil, request_options: nil)
12619
+ def principal(policy_id:, org_id: nil, request_options: nil)
12585
12620
  @transport.request(
12586
12621
  http_method: "GET",
12587
- path: "/api/org/{orgId}/leases/resource",
12588
- path_params: { "orgId" => org_id },
12589
- query: { "resourceId" => resource_id },
12622
+ path: "/api/org/{orgId}/jit-access/policies/{policyId}/principal",
12623
+ path_params: { "orgId" => org_id, "policyId" => policy_id },
12590
12624
  request_options: request_options
12591
12625
  )
12592
12626
  end
12593
12627
 
12594
- # Update a lease
12628
+ # Principals the caller may pick
12595
12629
  #
12596
- # Edit the deadline, the auto-delete opt-in and/or the note of an active
12597
- # lease. Changing the deadline or the auto-delete flag re-arms the
12598
- # two-announcement schedule. Audit-logged.
12630
+ # _Requires permission: `access:request`._
12599
12631
  #
12600
- # _Requires permission: `resources:write`._
12632
+ # GET /api/org/{orgId}/jit-access/policies/{policyId}/principals
12601
12633
  #
12602
- # PUT /api/org/{orgId}/leases/{leaseId}
12634
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12635
+ # constructed with.
12636
+ # @param policy_id [String]
12637
+ # @param q [String, nil]
12638
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12639
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<JitPrincipalOption & Hash>` — see
12640
+ # `sig/infrawrench/sdk.rbs`.
12641
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
12642
+ def principals(policy_id:, org_id: nil, q: nil, request_options: nil)
12643
+ @transport.request(
12644
+ http_method: "GET",
12645
+ path: "/api/org/{orgId}/jit-access/policies/{policyId}/principals",
12646
+ path_params: { "orgId" => org_id, "policyId" => policy_id },
12647
+ query: { "q" => q },
12648
+ request_options: request_options
12649
+ )
12650
+ end
12651
+
12652
+ # Replace a policy
12653
+ #
12654
+ # Live grants keep their window; pending requests are decided against the
12655
+ # new approver set.
12656
+ #
12657
+ # _Requires permission: `org:settings:write`._
12658
+ #
12659
+ # PUT /api/org/{orgId}/jit-access/policies/{policyId}
12603
12660
  #
12604
12661
  # Raises on 400: Bad request
12605
12662
  #
@@ -12607,212 +12664,327 @@ module Infrawrench
12607
12664
  #
12608
12665
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12609
12666
  # constructed with.
12610
- # @param lease_id [String]
12611
- # @param body [Hash, nil] Request body, shaped as `ResourceLeaseUpdate`.
12667
+ # @param policy_id [String]
12668
+ # @param body [Hash, nil] Request body, shaped as `JitPolicyInput`.
12612
12669
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12613
- # @return [Hash] Parsed JSON, shaped as `ResourceLease` — see `sig/infrawrench/sdk.rbs`.
12670
+ # @return [Hash] Parsed JSON, shaped as `JitPolicy` — see `sig/infrawrench/sdk.rbs`.
12614
12671
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12615
- def update(lease_id:, org_id: nil, body: nil, request_options: nil)
12672
+ def update(policy_id:, org_id: nil, body: nil, request_options: nil)
12616
12673
  @transport.request(
12617
12674
  http_method: "PUT",
12618
- path: "/api/org/{orgId}/leases/{leaseId}",
12619
- path_params: { "orgId" => org_id, "leaseId" => lease_id },
12675
+ path: "/api/org/{orgId}/jit-access/policies/{policyId}",
12676
+ path_params: { "orgId" => org_id, "policyId" => policy_id },
12620
12677
  body: body,
12621
12678
  request_options: request_options
12622
12679
  )
12623
12680
  end
12624
12681
  end
12625
12682
 
12626
- # `client.linear`
12627
- class LinearNamespace
12683
+ # `client.jit_access.requests`
12684
+ class JitAccessRequestsNamespace
12628
12685
  # @api private
12629
12686
  # @param transport [Transport]
12630
12687
  def initialize(transport)
12631
12688
  @transport = transport
12632
12689
  end
12633
12690
 
12634
- # Disconnect Linear
12691
+ # Approve a request
12635
12692
  #
12636
- # Issue links already recorded are kept, so filed findings stay marked as
12637
- # filed.
12693
+ # The caller must be in the policy's approver set at this moment. On
12694
+ # approval the provider grant is made; the response may still read
12695
+ # `granting` when it completes in the background. Audit-logged. Not
12696
+ # available to API keys.
12638
12697
  #
12639
- # _Requires permission: `linear:write`._
12698
+ # _Requires permission: `access:read`._
12640
12699
  #
12641
- # DELETE /api/org/{orgId}/linear
12700
+ # POST /api/org/{orgId}/jit-access/requests/{requestId}/approve
12701
+ #
12702
+ # Raises on 403: Not allowed
12642
12703
  #
12643
12704
  # Raises on 404: Not found
12644
12705
  #
12706
+ # Raises on 409: Already decided, timed out, or not in a state for this
12707
+ #
12645
12708
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12646
12709
  # constructed with.
12710
+ # @param request_id [String]
12711
+ # @param body [Hash, nil] Request body, shaped as `Hash`.
12647
12712
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12648
- # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
12713
+ # @return [Hash] Parsed JSON, shaped as `JitAccessRequest` — see `sig/infrawrench/sdk.rbs`.
12649
12714
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12650
- def delete(org_id: nil, request_options: nil)
12715
+ def approve(request_id:, org_id: nil, body: nil, request_options: nil)
12651
12716
  @transport.request(
12652
- http_method: "DELETE",
12653
- path: "/api/org/{orgId}/linear",
12654
- path_params: { "orgId" => org_id },
12717
+ http_method: "POST",
12718
+ path: "/api/org/{orgId}/jit-access/requests/{requestId}/approve",
12719
+ path_params: { "orgId" => org_id, "requestId" => request_id },
12720
+ body: body,
12655
12721
  request_options: request_options
12656
12722
  )
12657
12723
  end
12658
12724
 
12659
- # Get the org's Linear connection
12725
+ # Cancel your pending request
12660
12726
  #
12661
- # The stored API key is never returned; `keyHint` stands in for it.
12727
+ # Requester only. Audit-logged. Not available to API keys.
12662
12728
  #
12663
- # _Requires permission: `linear:read`._
12729
+ # _Requires permission: `access:request`._
12664
12730
  #
12665
- # GET /api/org/{orgId}/linear
12731
+ # POST /api/org/{orgId}/jit-access/requests/{requestId}/cancel
12732
+ #
12733
+ # Raises on 403: Not allowed
12734
+ #
12735
+ # Raises on 404: Not found
12736
+ #
12737
+ # Raises on 409: Already decided, timed out, or not in a state for this
12666
12738
  #
12667
12739
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12668
12740
  # constructed with.
12741
+ # @param request_id [String]
12742
+ # @param body [Hash, nil] Request body, shaped as `Hash`.
12669
12743
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12670
- # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
12744
+ # @return [Hash] Parsed JSON, shaped as `JitAccessRequest` — see `sig/infrawrench/sdk.rbs`.
12671
12745
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12672
- def get(org_id: nil, request_options: nil)
12746
+ def cancel(request_id:, org_id: nil, body: nil, request_options: nil)
12673
12747
  @transport.request(
12674
- http_method: "GET",
12675
- path: "/api/org/{orgId}/linear",
12676
- path_params: { "orgId" => org_id },
12748
+ http_method: "POST",
12749
+ path: "/api/org/{orgId}/jit-access/requests/{requestId}/cancel",
12750
+ path_params: { "orgId" => org_id, "requestId" => request_id },
12751
+ body: body,
12677
12752
  request_options: request_options
12678
12753
  )
12679
12754
  end
12680
12755
 
12681
- # File a finding as a Linear issue
12756
+ # Request just-in-time access
12682
12757
  #
12683
- # Creates the issue via the issueCreate mutation, then records the link
12684
- # between it and the finding. The link is what lets a list view show
12685
- # "already filed" instead of offering the button again.
12758
+ # Ask for one of a policy's scope and role pairs for a bounded window.
12759
+ # Approvers are notified over push, Slack (with Approve/Deny buttons) and
12760
+ # Microsoft Teams. Not available to API keys.
12686
12761
  #
12687
- # _Requires permission: `linear:write`._
12762
+ # _Requires permission: `access:request`._
12688
12763
  #
12689
- # POST /api/org/{orgId}/linear/issues
12764
+ # POST /api/org/{orgId}/jit-access/requests
12690
12765
  #
12691
- # Raises on 400: Bad request
12766
+ # Raises on 400: Invalid
12692
12767
  #
12693
- # Raises on 502: Linear refused to create the issue, or was unreachable
12768
+ # Raises on 403: Not a requester under this policy
12769
+ #
12770
+ # Raises on 409: A pending or active request already covers this
12694
12771
  #
12695
12772
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12696
12773
  # constructed with.
12697
- # @param body [Hash] Request body, shaped as `CreateLinearIssueInput`.
12774
+ # @param body [Hash, nil] Request body, shaped as `JitCreateRequest`.
12698
12775
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12699
- # @return [Hash] Parsed JSON, shaped as `CreateLinearIssueResult` — see
12700
- # `sig/infrawrench/sdk.rbs`.
12776
+ # @return [Hash] Parsed JSON, shaped as `JitAccessRequest` — see `sig/infrawrench/sdk.rbs`.
12701
12777
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12702
- def issues(body:, org_id: nil, request_options: nil)
12778
+ def create(org_id: nil, body: nil, request_options: nil)
12703
12779
  @transport.request(
12704
12780
  http_method: "POST",
12705
- path: "/api/org/{orgId}/linear/issues",
12781
+ path: "/api/org/{orgId}/jit-access/requests",
12706
12782
  path_params: { "orgId" => org_id },
12707
12783
  body: body,
12708
12784
  request_options: request_options
12709
12785
  )
12710
12786
  end
12711
12787
 
12712
- # Look up filed issues for a set of findings
12788
+ # Deny a request
12713
12789
  #
12714
- # _Requires permission: `linear:read`._
12790
+ # The caller must be in the policy's approver set. Audit-logged. Not
12791
+ # available to API keys.
12715
12792
  #
12716
- # GET /api/org/{orgId}/linear/links
12793
+ # _Requires permission: `access:read`._
12717
12794
  #
12718
- # Raises on 400: Bad request
12795
+ # POST /api/org/{orgId}/jit-access/requests/{requestId}/deny
12796
+ #
12797
+ # Raises on 403: Not allowed
12798
+ #
12799
+ # Raises on 404: Not found
12800
+ #
12801
+ # Raises on 409: Already decided, timed out, or not in a state for this
12719
12802
  #
12720
12803
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12721
12804
  # constructed with.
12722
- # @param source_kind [String, nil]
12723
- # @param source_id [Array<String>, nil] Repeat to narrow to specific findings. Omit to
12724
- # return every link of the kind; this is the batch lookup a list view makes once instead of
12725
- # one request per row.
12805
+ # @param request_id [String]
12806
+ # @param body [Hash, nil] Request body, shaped as `Hash`.
12726
12807
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12727
- # @return [Array<Hash>] Parsed JSON, shaped as `Array<LinearIssueLink>` — see
12728
- # `sig/infrawrench/sdk.rbs`.
12808
+ # @return [Hash] Parsed JSON, shaped as `JitAccessRequest` — see `sig/infrawrench/sdk.rbs`.
12729
12809
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12730
- def links(org_id: nil, source_kind: nil, source_id: nil, request_options: nil)
12810
+ def deny(request_id:, org_id: nil, body: nil, request_options: nil)
12731
12811
  @transport.request(
12732
- http_method: "GET",
12733
- path: "/api/org/{orgId}/linear/links",
12734
- path_params: { "orgId" => org_id },
12735
- query: { "sourceKind" => source_kind, "sourceId" => source_id },
12812
+ http_method: "POST",
12813
+ path: "/api/org/{orgId}/jit-access/requests/{requestId}/deny",
12814
+ path_params: { "orgId" => org_id, "requestId" => request_id },
12815
+ body: body,
12736
12816
  request_options: request_options
12737
12817
  )
12738
12818
  end
12739
12819
 
12740
- # List Linear teams
12820
+ # Extend an active grant
12741
12821
  #
12742
- # Backs the team picker, so nobody has to know a team id by hand;
12743
- # issueCreate requires one, and every issue belongs to exactly one team.
12822
+ # Approvers only, within the policy maximum for the whole window. A
12823
+ # provider-enforced expiry is moved upstream first. Audit-logged. Not
12824
+ # available to API keys.
12744
12825
  #
12745
- # _Requires permission: `linear:read`._
12826
+ # _Requires permission: `access:read`._
12746
12827
  #
12747
- # GET /api/org/{orgId}/linear/teams
12828
+ # POST /api/org/{orgId}/jit-access/requests/{requestId}/extend
12748
12829
  #
12749
- # Raises on 400: Bad request
12830
+ # Raises on 400: Beyond the policy maximum
12831
+ #
12832
+ # Raises on 403: Not an approver
12833
+ #
12834
+ # Raises on 409: Not active
12750
12835
  #
12751
12836
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12752
12837
  # constructed with.
12838
+ # @param request_id [String]
12839
+ # @param body [Hash, nil] Request body, shaped as `Hash`.
12753
12840
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12754
- # @return [Array<Hash>] Parsed JSON, shaped as `Array<LinearTeam>` — see
12755
- # `sig/infrawrench/sdk.rbs`.
12841
+ # @return [Hash] Parsed JSON, shaped as `JitAccessRequest` — see `sig/infrawrench/sdk.rbs`.
12756
12842
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12757
- def teams(org_id: nil, request_options: nil)
12843
+ def post_org_org_id_jit_access_requests_request_id_extend(
12844
+ request_id:,
12845
+ org_id: nil,
12846
+ body: nil,
12847
+ request_options: nil
12848
+ )
12849
+ @transport.request(
12850
+ http_method: "POST",
12851
+ path: "/api/org/{orgId}/jit-access/requests/{requestId}/extend",
12852
+ path_params: { "orgId" => org_id, "requestId" => request_id },
12853
+ body: body,
12854
+ request_options: request_options
12855
+ )
12856
+ end
12857
+
12858
+ # Get a request
12859
+ #
12860
+ # _Requires permission: `access:read`._
12861
+ #
12862
+ # GET /api/org/{orgId}/jit-access/requests/{requestId}
12863
+ #
12864
+ # Raises on 404: Not found
12865
+ #
12866
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12867
+ # constructed with.
12868
+ # @param request_id [String]
12869
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12870
+ # @return [Hash] Parsed JSON, shaped as `JitAccessRequest` — see `sig/infrawrench/sdk.rbs`.
12871
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
12872
+ def get(request_id:, org_id: nil, request_options: nil)
12758
12873
  @transport.request(
12759
12874
  http_method: "GET",
12760
- path: "/api/org/{orgId}/linear/teams",
12761
- path_params: { "orgId" => org_id },
12875
+ path: "/api/org/{orgId}/jit-access/requests/{requestId}",
12876
+ path_params: { "orgId" => org_id, "requestId" => request_id },
12762
12877
  request_options: request_options
12763
12878
  )
12764
12879
  end
12765
12880
 
12766
- # Connect Linear, or update the connection
12881
+ # List just-in-time access requests
12767
12882
  #
12768
- # _Requires permission: `linear:write`._
12883
+ # Newest first, with caller-relative action flags.
12769
12884
  #
12770
- # PUT /api/org/{orgId}/linear
12885
+ # _Requires permission: `access:read`._
12886
+ #
12887
+ # GET /api/org/{orgId}/jit-access/requests
12771
12888
  #
12772
12889
  # Raises on 400: Bad request
12773
12890
  #
12774
12891
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12775
12892
  # constructed with.
12776
- # @param body [Hash] Request body, shaped as `LinearIntegrationInput`.
12893
+ # @param status [String, nil]
12894
+ # @param mine [String, nil]
12895
+ # @param holding [String, nil] Only rows that may be holding access upstream.
12777
12896
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12778
- # @return [Hash] Parsed JSON, shaped as `LinearIntegration & Hash` — see
12897
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<JitAccessRequest>` — see
12779
12898
  # `sig/infrawrench/sdk.rbs`.
12780
12899
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12781
- def update(body:, org_id: nil, request_options: nil)
12900
+ def list(org_id: nil, status: nil, mine: nil, holding: nil, request_options: nil)
12782
12901
  @transport.request(
12783
- http_method: "PUT",
12784
- path: "/api/org/{orgId}/linear",
12902
+ http_method: "GET",
12903
+ path: "/api/org/{orgId}/jit-access/requests",
12785
12904
  path_params: { "orgId" => org_id },
12786
- body: body,
12905
+ query: { "status" => status, "mine" => mine, "holding" => holding },
12787
12906
  request_options: request_options
12788
12907
  )
12789
12908
  end
12790
12909
 
12791
- # Check Linear credentials
12910
+ # End a grant early
12792
12911
  #
12793
- # Runs the `viewer` query against the Linear GraphQL API, so a mistyped or
12794
- # revoked key is reported on the settings form rather than on the first
12795
- # attempt to file an issue.
12912
+ # Allowed for the holder, an approver, or a member with org:settings:write.
12913
+ # Audit-logged. Not available to API keys.
12796
12914
  #
12797
- # _Requires permission: `linear:write`._
12915
+ # POST /api/org/{orgId}/jit-access/requests/{requestId}/revoke
12798
12916
  #
12799
- # POST /api/org/{orgId}/linear/verify
12917
+ # Raises on 403: Not allowed
12918
+ #
12919
+ # Raises on 404: Not found
12920
+ #
12921
+ # Raises on 409: Already decided, timed out, or not in a state for this
12922
+ #
12923
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12924
+ # constructed with.
12925
+ # @param request_id [String]
12926
+ # @param body [Hash, nil] Request body, shaped as `Hash`.
12927
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12928
+ # @return [Hash] Parsed JSON, shaped as `JitAccessRequest` — see `sig/infrawrench/sdk.rbs`.
12929
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
12930
+ def revoke(request_id:, org_id: nil, body: nil, request_options: nil)
12931
+ @transport.request(
12932
+ http_method: "POST",
12933
+ path: "/api/org/{orgId}/jit-access/requests/{requestId}/revoke",
12934
+ path_params: { "orgId" => org_id, "requestId" => request_id },
12935
+ body: body,
12936
+ request_options: request_options
12937
+ )
12938
+ end
12939
+ end
12940
+
12941
+ # `client.jit_access`
12942
+ class JitAccessNamespace
12943
+ # @return [JitAccessAccountsNamespace] `client.jit_access.accounts`
12944
+ attr_reader :accounts
12945
+ # @return [JitAccessPoliciesNamespace] `client.jit_access.policies`
12946
+ attr_reader :policies
12947
+ # @return [JitAccessRequestsNamespace] `client.jit_access.requests`
12948
+ attr_reader :requests
12949
+
12950
+ # @api private
12951
+ # @param transport [Transport]
12952
+ def initialize(transport)
12953
+ @transport = transport
12954
+ @accounts = JitAccessAccountsNamespace.new(@transport)
12955
+ @policies = JitAccessPoliciesNamespace.new(@transport)
12956
+ @requests = JitAccessRequestsNamespace.new(@transport)
12957
+ end
12958
+ end
12959
+
12960
+ # `client.kv`
12961
+ class KvNamespace
12962
+ # @api private
12963
+ # @param transport [Transport]
12964
+ def initialize(transport)
12965
+ @transport = transport
12966
+ end
12967
+
12968
+ # Run a Redis-style KV command
12969
+ #
12970
+ # _Requires permission: `resources:execute`._
12971
+ #
12972
+ # POST /api/org/{orgId}/kv/command
12800
12973
  #
12801
12974
  # Raises on 400: Bad request
12802
12975
  #
12803
- # Raises on 502: Linear rejected the key or was unreachable
12976
+ # Raises on 404: Not found
12804
12977
  #
12805
12978
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12806
12979
  # constructed with.
12807
- # @param body [Hash, nil] Request body, shaped as `LinearVerifyInput`.
12980
+ # @param body [Hash] Request body, shaped as `KvCommandRequest`.
12808
12981
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12809
- # @return [Hash] Parsed JSON, shaped as `LinearVerifyResult` — see
12810
- # `sig/infrawrench/sdk.rbs`.
12982
+ # @return [Hash] Parsed JSON, shaped as `KvCommandResponse` — see `sig/infrawrench/sdk.rbs`.
12811
12983
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12812
- def verify(org_id: nil, body: nil, request_options: nil)
12984
+ def command(body:, org_id: nil, request_options: nil)
12813
12985
  @transport.request(
12814
12986
  http_method: "POST",
12815
- path: "/api/org/{orgId}/linear/verify",
12987
+ path: "/api/org/{orgId}/kv/command",
12816
12988
  path_params: { "orgId" => org_id },
12817
12989
  body: body,
12818
12990
  request_options: request_options
@@ -12820,627 +12992,732 @@ module Infrawrench
12820
12992
  end
12821
12993
  end
12822
12994
 
12823
- # `client.log_workspaces`
12824
- class LogWorkspacesNamespace
12995
+ # `client.leases`
12996
+ class LeasesNamespace
12825
12997
  # @api private
12826
12998
  # @param transport [Transport]
12827
12999
  def initialize(transport)
12828
13000
  @transport = transport
12829
13001
  end
12830
13002
 
12831
- # Save a log workspace query
13003
+ # Cancel a lease
12832
13004
  #
12833
- # Save a named multi-resource tail: up to 8 log streams plus a search
12834
- # expression, so the workspace can be reopened. With `alertEnabled` the
12835
- # poller evaluates the query every few minutes over a bounded tail window
12836
- # and notifies (push/Slack/Teams, `logMatchAlerts` trigger) when a line
12837
- # matches, with a cooldown between alerts. Alerting requires a non-empty
12838
- # search expression. Audit-logged.
13005
+ # Stop the countdown; the resource stays, the lease goes `canceled` and
13006
+ # leaves the expiry radar. Audit-logged.
12839
13007
  #
12840
13008
  # _Requires permission: `resources:write`._
12841
13009
  #
12842
- # POST /api/org/{orgId}/log-workspaces
13010
+ # POST /api/org/{orgId}/leases/{leaseId}/cancel
12843
13011
  #
12844
13012
  # Raises on 400: Bad request
12845
13013
  #
12846
13014
  # Raises on 404: Not found
12847
13015
  #
12848
- # Raises on 409: A saved query with this name already exists
13016
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13017
+ # constructed with.
13018
+ # @param lease_id [String]
13019
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13020
+ # @return [Hash] Parsed JSON, shaped as `ResourceLease` — see `sig/infrawrench/sdk.rbs`.
13021
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
13022
+ def cancel(lease_id:, org_id: nil, request_options: nil)
13023
+ @transport.request(
13024
+ http_method: "POST",
13025
+ path: "/api/org/{orgId}/leases/{leaseId}/cancel",
13026
+ path_params: { "orgId" => org_id, "leaseId" => lease_id },
13027
+ request_options: request_options
13028
+ )
13029
+ end
13030
+
13031
+ # Create a resource lease
13032
+ #
13033
+ # Attach an expiry to a resource; 'give me a test cluster for 3 days'. One
13034
+ # lease per resource (an active lease conflicts; a terminal one is
13035
+ # replaced). `autoDelete: true` opts into deletion at expiry; the poller
13036
+ # announces it twice first, defers during change freezes, and requires the
13037
+ # caller to hold `resources:delete`. Audit-logged.
13038
+ #
13039
+ # _Requires permission: `resources:write`._
13040
+ #
13041
+ # POST /api/org/{orgId}/leases
13042
+ #
13043
+ # Raises on 400: Bad request
13044
+ #
13045
+ # Raises on 404: Not found
13046
+ #
13047
+ # Raises on 409: The resource already has an active lease
12849
13048
  #
12850
13049
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12851
13050
  # constructed with.
12852
- # @param body [Hash] Request body, shaped as `LogWorkspaceQueryCreate`.
13051
+ # @param body [Hash, nil] Request body, shaped as `ResourceLeaseCreate`.
12853
13052
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12854
- # @return [Hash] Parsed JSON, shaped as `LogWorkspaceQuery` — see `sig/infrawrench/sdk.rbs`.
13053
+ # @return [Hash] Parsed JSON, shaped as `ResourceLease` — see `sig/infrawrench/sdk.rbs`.
12855
13054
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12856
- def create(body:, org_id: nil, request_options: nil)
13055
+ def create(org_id: nil, body: nil, request_options: nil)
12857
13056
  @transport.request(
12858
13057
  http_method: "POST",
12859
- path: "/api/org/{orgId}/log-workspaces",
13058
+ path: "/api/org/{orgId}/leases",
12860
13059
  path_params: { "orgId" => org_id },
12861
13060
  body: body,
12862
13061
  request_options: request_options
12863
13062
  )
12864
13063
  end
12865
13064
 
12866
- # Delete a saved log query
13065
+ # Delete a lease row
12867
13066
  #
12868
- # Remove the saved query and stop any alerting it carried. Audit-logged.
13067
+ # Remove the lease record entirely (including terminal rows). The resource
13068
+ # is not touched. Audit-logged.
12869
13069
  #
12870
13070
  # _Requires permission: `resources:write`._
12871
13071
  #
12872
- # DELETE /api/org/{orgId}/log-workspaces/{queryId}
13072
+ # DELETE /api/org/{orgId}/leases/{leaseId}
12873
13073
  #
12874
13074
  # Raises on 404: Not found
12875
13075
  #
12876
13076
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12877
13077
  # constructed with.
12878
- # @param query_id [String]
13078
+ # @param lease_id [String]
12879
13079
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12880
13080
  # @return [nil] This endpoint returns no content.
12881
13081
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12882
- def delete(query_id:, org_id: nil, request_options: nil)
13082
+ def delete(lease_id:, org_id: nil, request_options: nil)
12883
13083
  @transport.request(
12884
13084
  http_method: "DELETE",
12885
- path: "/api/org/{orgId}/log-workspaces/{queryId}",
12886
- path_params: { "orgId" => org_id, "queryId" => query_id },
13085
+ path: "/api/org/{orgId}/leases/{leaseId}",
13086
+ path_params: { "orgId" => org_id, "leaseId" => lease_id },
12887
13087
  accept: :empty,
12888
13088
  request_options: request_options
12889
13089
  )
12890
13090
  end
12891
13091
 
12892
- # List saved log queries
13092
+ # List resource leases
12893
13093
  #
12894
- # Every saved log-workspace query in the organization: its name, the set of
12895
- # log streams it tails, the search expression, the alert flag and the alert
12896
- # pass's last evaluation state. Log text itself is fetched per resource via
12897
- # `POST /api/org/{orgId}/resources/{pluginId}/{typeId}/logs`.
13094
+ # Every lease in the organization, soonest deadline first. Active leases
13095
+ # also appear on the expiry radar (`GET /expiring`) as kind `lease` items,
13096
+ # so the owner is nagged through the existing expiry alerts.
12898
13097
  #
12899
13098
  # _Requires permission: `resources:read`._
12900
13099
  #
12901
- # GET /api/org/{orgId}/log-workspaces
13100
+ # GET /api/org/{orgId}/leases
12902
13101
  #
12903
13102
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12904
13103
  # constructed with.
12905
13104
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12906
- # @return [Hash] Parsed JSON, shaped as `LogWorkspaceQueryList` — see
12907
- # `sig/infrawrench/sdk.rbs`.
13105
+ # @return [Hash] Parsed JSON, shaped as `ResourceLeaseList` — see `sig/infrawrench/sdk.rbs`.
12908
13106
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12909
13107
  def get(org_id: nil, request_options: nil)
12910
13108
  @transport.request(
12911
13109
  http_method: "GET",
12912
- path: "/api/org/{orgId}/log-workspaces",
13110
+ path: "/api/org/{orgId}/leases",
12913
13111
  path_params: { "orgId" => org_id },
12914
13112
  request_options: request_options
12915
13113
  )
12916
13114
  end
12917
13115
 
12918
- # List log-capable resources
13116
+ # Get one resource's lease
12919
13117
  #
12920
- # Synced resources whose rendered detail declares the logs capability (the
12921
- # candidates a log workspace can tail) plus sidecar streams reached through
12922
- # a peer integration (pods and workloads inside a managed cluster, listed
12923
- # live from the provider and marked with `parentResourceId`). Discovered
12924
- # from the plugin contract (never a hardcoded provider list), capped at 500
12925
- # results.
13118
+ # The (unique) lease on a resource, whatever its status, or null.
12926
13119
  #
12927
13120
  # _Requires permission: `resources:read`._
12928
13121
  #
12929
- # GET /api/org/{orgId}/log-workspaces/resources
13122
+ # GET /api/org/{orgId}/leases/resource
13123
+ #
13124
+ # Raises on 400: Bad request
12930
13125
  #
12931
13126
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12932
13127
  # constructed with.
13128
+ # @param resource_id [String]
12933
13129
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12934
- # @return [Hash] Parsed JSON, shaped as `LogCapableResourceList` — see
13130
+ # @return [Hash] Parsed JSON, shaped as `ResourceLeaseLookup` — see
12935
13131
  # `sig/infrawrench/sdk.rbs`.
12936
13132
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12937
- def resources(org_id: nil, request_options: nil)
13133
+ def resource(resource_id:, org_id: nil, request_options: nil)
12938
13134
  @transport.request(
12939
13135
  http_method: "GET",
12940
- path: "/api/org/{orgId}/log-workspaces/resources",
13136
+ path: "/api/org/{orgId}/leases/resource",
12941
13137
  path_params: { "orgId" => org_id },
13138
+ query: { "resourceId" => resource_id },
12942
13139
  request_options: request_options
12943
13140
  )
12944
13141
  end
12945
13142
 
12946
- # Update a saved log query
13143
+ # Update a lease
12947
13144
  #
12948
- # Edit the name, resource set, search expression and/or the alert toggle.
12949
- # Changing the search or the resources resets the alert pass's evaluation
12950
- # state; turning the alert on makes the query due for evaluation
12951
- # immediately. Audit-logged.
13145
+ # Edit the deadline, the auto-delete opt-in and/or the note of an active
13146
+ # lease. Changing the deadline or the auto-delete flag re-arms the
13147
+ # two-announcement schedule. Audit-logged.
12952
13148
  #
12953
13149
  # _Requires permission: `resources:write`._
12954
13150
  #
12955
- # PUT /api/org/{orgId}/log-workspaces/{queryId}
13151
+ # PUT /api/org/{orgId}/leases/{leaseId}
12956
13152
  #
12957
13153
  # Raises on 400: Bad request
12958
13154
  #
12959
13155
  # Raises on 404: Not found
12960
13156
  #
12961
- # Raises on 409: A saved query with this name already exists
12962
- #
12963
13157
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
12964
13158
  # constructed with.
12965
- # @param query_id [String]
12966
- # @param body [Hash] Request body, shaped as `LogWorkspaceQueryUpdate`.
13159
+ # @param lease_id [String]
13160
+ # @param body [Hash, nil] Request body, shaped as `ResourceLeaseUpdate`.
12967
13161
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
12968
- # @return [Hash] Parsed JSON, shaped as `LogWorkspaceQuery` — see `sig/infrawrench/sdk.rbs`.
13162
+ # @return [Hash] Parsed JSON, shaped as `ResourceLease` — see `sig/infrawrench/sdk.rbs`.
12969
13163
  # @raise [Infrawrench::ApiError] On any non-2xx response.
12970
- def update(query_id:, body:, org_id: nil, request_options: nil)
13164
+ def update(lease_id:, org_id: nil, body: nil, request_options: nil)
12971
13165
  @transport.request(
12972
13166
  http_method: "PUT",
12973
- path: "/api/org/{orgId}/log-workspaces/{queryId}",
12974
- path_params: { "orgId" => org_id, "queryId" => query_id },
13167
+ path: "/api/org/{orgId}/leases/{leaseId}",
13168
+ path_params: { "orgId" => org_id, "leaseId" => lease_id },
12975
13169
  body: body,
12976
13170
  request_options: request_options
12977
13171
  )
12978
13172
  end
12979
13173
  end
12980
13174
 
12981
- # `client.managed_accounts`
12982
- class ManagedAccountsNamespace
13175
+ # `client.linear`
13176
+ class LinearNamespace
12983
13177
  # @api private
12984
13178
  # @param transport [Transport]
12985
13179
  def initialize(transport)
12986
13180
  @transport = transport
12987
13181
  end
12988
13182
 
12989
- # Create a managed account
13183
+ # Disconnect Linear
12990
13184
  #
12991
- # Refused with 409 when a cost centre or account named here is already
12992
- # billed to another customer. The error names the other customer, because
12993
- # “it conflicts” without saying with whom sends the caller hunting.
13185
+ # Issue links already recorded are kept, so filed findings stay marked as
13186
+ # filed.
12994
13187
  #
12995
- # _Requires permission: `invoices:write`._
13188
+ # _Requires permission: `linear:write`._
12996
13189
  #
12997
- # POST /api/org/{orgId}/managed-accounts
13190
+ # DELETE /api/org/{orgId}/linear
13191
+ #
13192
+ # Raises on 404: Not found
13193
+ #
13194
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13195
+ # constructed with.
13196
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13197
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
13198
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
13199
+ def delete(org_id: nil, request_options: nil)
13200
+ @transport.request(
13201
+ http_method: "DELETE",
13202
+ path: "/api/org/{orgId}/linear",
13203
+ path_params: { "orgId" => org_id },
13204
+ request_options: request_options
13205
+ )
13206
+ end
13207
+
13208
+ # Get the org's Linear connection
13209
+ #
13210
+ # The stored API key is never returned; `keyHint` stands in for it.
13211
+ #
13212
+ # _Requires permission: `linear:read`._
13213
+ #
13214
+ # GET /api/org/{orgId}/linear
13215
+ #
13216
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13217
+ # constructed with.
13218
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13219
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
13220
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
13221
+ def get(org_id: nil, request_options: nil)
13222
+ @transport.request(
13223
+ http_method: "GET",
13224
+ path: "/api/org/{orgId}/linear",
13225
+ path_params: { "orgId" => org_id },
13226
+ request_options: request_options
13227
+ )
13228
+ end
13229
+
13230
+ # File a finding as a Linear issue
13231
+ #
13232
+ # Creates the issue via the issueCreate mutation, then records the link
13233
+ # between it and the finding. The link is what lets a list view show
13234
+ # "already filed" instead of offering the button again.
13235
+ #
13236
+ # _Requires permission: `linear:write`._
13237
+ #
13238
+ # POST /api/org/{orgId}/linear/issues
12998
13239
  #
12999
13240
  # Raises on 400: Bad request
13000
13241
  #
13001
- # Raises on 409: Conflict
13242
+ # Raises on 502: Linear refused to create the issue, or was unreachable
13002
13243
  #
13003
13244
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13004
13245
  # constructed with.
13005
- # @param body [Hash] Request body, shaped as `ManagedAccountInput`.
13246
+ # @param body [Hash] Request body, shaped as `CreateLinearIssueInput`.
13006
13247
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13007
- # @return [Hash] Parsed JSON, shaped as `ManagedAccount` — see `sig/infrawrench/sdk.rbs`.
13248
+ # @return [Hash] Parsed JSON, shaped as `CreateLinearIssueResult` — see
13249
+ # `sig/infrawrench/sdk.rbs`.
13008
13250
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13009
- def create(body:, org_id: nil, request_options: nil)
13251
+ def issues(body:, org_id: nil, request_options: nil)
13010
13252
  @transport.request(
13011
13253
  http_method: "POST",
13012
- path: "/api/org/{orgId}/managed-accounts",
13254
+ path: "/api/org/{orgId}/linear/issues",
13013
13255
  path_params: { "orgId" => org_id },
13014
13256
  body: body,
13015
13257
  request_options: request_options
13016
13258
  )
13017
13259
  end
13018
13260
 
13019
- # Retire a managed account
13020
- #
13021
- # A soft delete: an issued invoice names its customer, and an invoice whose
13022
- # customer stopped resolving is exactly the unreconcilable document this
13023
- # feature exists to prevent. Draft invoices are removed with it; a draft was
13024
- # never issued.
13261
+ # Look up filed issues for a set of findings
13025
13262
  #
13026
- # _Requires permission: `invoices:write`._
13263
+ # _Requires permission: `linear:read`._
13027
13264
  #
13028
- # DELETE /api/org/{orgId}/managed-accounts/{id}
13265
+ # GET /api/org/{orgId}/linear/links
13029
13266
  #
13030
- # Raises on 404: Not found
13267
+ # Raises on 400: Bad request
13031
13268
  #
13032
13269
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13033
13270
  # constructed with.
13034
- # @param id [String]
13271
+ # @param source_kind [String, nil]
13272
+ # @param source_id [Array<String>, nil] Repeat to narrow to specific findings. Omit to
13273
+ # return every link of the kind; this is the batch lookup a list view makes once instead of
13274
+ # one request per row.
13035
13275
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13036
- # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
13276
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<LinearIssueLink>` — see
13277
+ # `sig/infrawrench/sdk.rbs`.
13037
13278
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13038
- def delete(id:, org_id: nil, request_options: nil)
13279
+ def links(org_id: nil, source_kind: nil, source_id: nil, request_options: nil)
13039
13280
  @transport.request(
13040
- http_method: "DELETE",
13041
- path: "/api/org/{orgId}/managed-accounts/{id}",
13042
- path_params: { "orgId" => org_id, "id" => id },
13281
+ http_method: "GET",
13282
+ path: "/api/org/{orgId}/linear/links",
13283
+ path_params: { "orgId" => org_id },
13284
+ query: { "sourceKind" => source_kind, "sourceId" => source_id },
13043
13285
  request_options: request_options
13044
13286
  )
13045
13287
  end
13046
13288
 
13047
- # Get a managed account
13289
+ # List Linear teams
13048
13290
  #
13049
- # _Requires permission: `invoices:read`._
13291
+ # Backs the team picker, so nobody has to know a team id by hand;
13292
+ # issueCreate requires one, and every issue belongs to exactly one team.
13050
13293
  #
13051
- # GET /api/org/{orgId}/managed-accounts/{id}
13294
+ # _Requires permission: `linear:read`._
13052
13295
  #
13053
- # Raises on 404: Not found
13296
+ # GET /api/org/{orgId}/linear/teams
13297
+ #
13298
+ # Raises on 400: Bad request
13054
13299
  #
13055
13300
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13056
13301
  # constructed with.
13057
- # @param id [String]
13058
13302
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13059
- # @return [Hash] Parsed JSON, shaped as `ManagedAccount` — see `sig/infrawrench/sdk.rbs`.
13303
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<LinearTeam>` — see
13304
+ # `sig/infrawrench/sdk.rbs`.
13060
13305
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13061
- def get(id:, org_id: nil, request_options: nil)
13306
+ def teams(org_id: nil, request_options: nil)
13062
13307
  @transport.request(
13063
13308
  http_method: "GET",
13064
- path: "/api/org/{orgId}/managed-accounts/{id}",
13065
- path_params: { "orgId" => org_id, "id" => id },
13309
+ path: "/api/org/{orgId}/linear/teams",
13310
+ path_params: { "orgId" => org_id },
13066
13311
  request_options: request_options
13067
13312
  )
13068
13313
  end
13069
13314
 
13070
- # List managed accounts
13315
+ # Connect Linear, or update the connection
13071
13316
  #
13072
- # The customers a managed service provider bills. A managed account
13073
- # references existing cost centres rather than defining its own matching
13074
- # rules, so the spend on an invoice is the same spend the showback report
13075
- # attributes to those centres.
13317
+ # _Requires permission: `linear:write`._
13076
13318
  #
13077
- # _Requires permission: `invoices:read`._
13319
+ # PUT /api/org/{orgId}/linear
13078
13320
  #
13079
- # GET /api/org/{orgId}/managed-accounts
13321
+ # Raises on 400: Bad request
13080
13322
  #
13081
13323
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13082
13324
  # constructed with.
13325
+ # @param body [Hash] Request body, shaped as `LinearIntegrationInput`.
13083
13326
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13084
- # @return [Array<Hash>] Parsed JSON, shaped as `Array<ManagedAccount>` — see
13327
+ # @return [Hash] Parsed JSON, shaped as `LinearIntegration & Hash` — see
13085
13328
  # `sig/infrawrench/sdk.rbs`.
13086
13329
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13087
- def list(org_id: nil, request_options: nil)
13330
+ def update(body:, org_id: nil, request_options: nil)
13088
13331
  @transport.request(
13089
- http_method: "GET",
13090
- path: "/api/org/{orgId}/managed-accounts",
13332
+ http_method: "PUT",
13333
+ path: "/api/org/{orgId}/linear",
13091
13334
  path_params: { "orgId" => org_id },
13335
+ body: body,
13092
13336
  request_options: request_options
13093
13337
  )
13094
13338
  end
13095
13339
 
13096
- # Update a managed account
13340
+ # Check Linear credentials
13097
13341
  #
13098
- # A full replace. Editing the scope changes what **future** drafts are drawn
13099
- # over and nothing else: every approved invoice holds its own copy of the
13100
- # scope, so moving a cost centre between customers cannot re-bill a period
13101
- # that has already been invoiced.
13342
+ # Runs the `viewer` query against the Linear GraphQL API, so a mistyped or
13343
+ # revoked key is reported on the settings form rather than on the first
13344
+ # attempt to file an issue.
13102
13345
  #
13103
- # _Requires permission: `invoices:write`._
13346
+ # _Requires permission: `linear:write`._
13104
13347
  #
13105
- # PUT /api/org/{orgId}/managed-accounts/{id}
13348
+ # POST /api/org/{orgId}/linear/verify
13106
13349
  #
13107
13350
  # Raises on 400: Bad request
13108
13351
  #
13109
- # Raises on 404: Not found
13110
- #
13111
- # Raises on 409: Conflict
13352
+ # Raises on 502: Linear rejected the key or was unreachable
13112
13353
  #
13113
13354
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13114
13355
  # constructed with.
13115
- # @param id [String]
13116
- # @param body [Hash] Request body, shaped as `ManagedAccountInput`.
13356
+ # @param body [Hash, nil] Request body, shaped as `LinearVerifyInput`.
13117
13357
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13118
- # @return [Hash] Parsed JSON, shaped as `ManagedAccount` — see `sig/infrawrench/sdk.rbs`.
13358
+ # @return [Hash] Parsed JSON, shaped as `LinearVerifyResult` — see
13359
+ # `sig/infrawrench/sdk.rbs`.
13119
13360
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13120
- def update(id:, body:, org_id: nil, request_options: nil)
13361
+ def verify(org_id: nil, body: nil, request_options: nil)
13121
13362
  @transport.request(
13122
- http_method: "PUT",
13123
- path: "/api/org/{orgId}/managed-accounts/{id}",
13124
- path_params: { "orgId" => org_id, "id" => id },
13363
+ http_method: "POST",
13364
+ path: "/api/org/{orgId}/linear/verify",
13365
+ path_params: { "orgId" => org_id },
13125
13366
  body: body,
13126
13367
  request_options: request_options
13127
13368
  )
13128
13369
  end
13129
13370
  end
13130
13371
 
13131
- # `client.metric_alerts`
13132
- class MetricAlertsNamespace
13372
+ # `client.log_workspaces`
13373
+ class LogWorkspacesNamespace
13133
13374
  # @api private
13134
13375
  # @param transport [Transport]
13135
13376
  def initialize(transport)
13136
13377
  @transport = transport
13137
13378
  end
13138
13379
 
13139
- # Create a metric alert rule
13380
+ # Save a log workspace query
13140
13381
  #
13141
- # Rules select resources by query (plugin + resource type + tag), never by
13142
- # id list, so a rule automatically covers resources created after it was
13143
- # written. The poller evaluates enabled rules about once a minute and alerts
13144
- # when the condition held for the whole trailing window.
13382
+ # Save a named multi-resource tail: up to 8 log streams plus a search
13383
+ # expression, so the workspace can be reopened. With `alertEnabled` the
13384
+ # poller evaluates the query every few minutes over a bounded tail window
13385
+ # and notifies (push/Slack/Teams, `logMatchAlerts` trigger) when a line
13386
+ # matches, with a cooldown between alerts. Alerting requires a non-empty
13387
+ # search expression. Audit-logged.
13145
13388
  #
13146
- # POST /api/org/{orgId}/metric-alerts
13389
+ # _Requires permission: `resources:write`._
13390
+ #
13391
+ # POST /api/org/{orgId}/log-workspaces
13147
13392
  #
13148
13393
  # Raises on 400: Bad request
13149
13394
  #
13395
+ # Raises on 404: Not found
13396
+ #
13397
+ # Raises on 409: A saved query with this name already exists
13398
+ #
13150
13399
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13151
13400
  # constructed with.
13152
- # @param body [Hash] Request body, shaped as `MetricAlertRuleInput`.
13401
+ # @param body [Hash] Request body, shaped as `LogWorkspaceQueryCreate`.
13153
13402
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13154
- # @return [Hash] Parsed JSON, shaped as `MetricAlertRule` — see `sig/infrawrench/sdk.rbs`.
13403
+ # @return [Hash] Parsed JSON, shaped as `LogWorkspaceQuery` — see `sig/infrawrench/sdk.rbs`.
13155
13404
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13156
13405
  def create(body:, org_id: nil, request_options: nil)
13157
13406
  @transport.request(
13158
13407
  http_method: "POST",
13159
- path: "/api/org/{orgId}/metric-alerts",
13408
+ path: "/api/org/{orgId}/log-workspaces",
13160
13409
  path_params: { "orgId" => org_id },
13161
13410
  body: body,
13162
13411
  request_options: request_options
13163
13412
  )
13164
13413
  end
13165
13414
 
13166
- # Delete a metric alert rule
13415
+ # Delete a saved log query
13167
13416
  #
13168
- # Soft delete. The rule's firing history stays readable via
13169
- # /metric-alerts/events.
13417
+ # Remove the saved query and stop any alerting it carried. Audit-logged.
13170
13418
  #
13171
- # DELETE /api/org/{orgId}/metric-alerts/{id}
13419
+ # _Requires permission: `resources:write`._
13420
+ #
13421
+ # DELETE /api/org/{orgId}/log-workspaces/{queryId}
13172
13422
  #
13173
13423
  # Raises on 404: Not found
13174
13424
  #
13175
13425
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13176
13426
  # constructed with.
13177
- # @param id [String]
13427
+ # @param query_id [String]
13178
13428
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13179
- # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
13429
+ # @return [nil] This endpoint returns no content.
13180
13430
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13181
- def delete(id:, org_id: nil, request_options: nil)
13431
+ def delete(query_id:, org_id: nil, request_options: nil)
13182
13432
  @transport.request(
13183
13433
  http_method: "DELETE",
13184
- path: "/api/org/{orgId}/metric-alerts/{id}",
13185
- path_params: { "orgId" => org_id, "id" => id },
13434
+ path: "/api/org/{orgId}/log-workspaces/{queryId}",
13435
+ path_params: { "orgId" => org_id, "queryId" => query_id },
13436
+ accept: :empty,
13186
13437
  request_options: request_options
13187
13438
  )
13188
13439
  end
13189
13440
 
13190
- # Recent metric alert firings
13441
+ # List saved log queries
13191
13442
  #
13192
- # GET /api/org/{orgId}/metric-alerts/events
13443
+ # Every saved log-workspace query in the organization: its name, the set of
13444
+ # log streams it tails, the search expression, the alert flag and the alert
13445
+ # pass's last evaluation state. Log text itself is fetched per resource via
13446
+ # `POST /api/org/{orgId}/resources/{pluginId}/{typeId}/logs`.
13447
+ #
13448
+ # _Requires permission: `resources:read`._
13449
+ #
13450
+ # GET /api/org/{orgId}/log-workspaces
13193
13451
  #
13194
13452
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13195
13453
  # constructed with.
13196
- # @param rule_id [String, nil]
13197
- # @param limit [Integer, nil]
13198
13454
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13199
- # @return [Array<Hash>] Parsed JSON, shaped as `Array<MetricAlertEvent>` — see
13455
+ # @return [Hash] Parsed JSON, shaped as `LogWorkspaceQueryList` — see
13200
13456
  # `sig/infrawrench/sdk.rbs`.
13201
13457
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13202
- def events(org_id: nil, rule_id: nil, limit: nil, request_options: nil)
13458
+ def get(org_id: nil, request_options: nil)
13203
13459
  @transport.request(
13204
13460
  http_method: "GET",
13205
- path: "/api/org/{orgId}/metric-alerts/events",
13461
+ path: "/api/org/{orgId}/log-workspaces",
13206
13462
  path_params: { "orgId" => org_id },
13207
- query: { "ruleId" => rule_id, "limit" => limit },
13208
13463
  request_options: request_options
13209
13464
  )
13210
13465
  end
13211
13466
 
13212
- # Get a metric alert rule
13467
+ # List log-capable resources
13213
13468
  #
13214
- # GET /api/org/{orgId}/metric-alerts/{id}
13469
+ # Synced resources whose rendered detail declares the logs capability (the
13470
+ # candidates a log workspace can tail) plus sidecar streams reached through
13471
+ # a peer integration (pods and workloads inside a managed cluster, listed
13472
+ # live from the provider and marked with `parentResourceId`). Discovered
13473
+ # from the plugin contract (never a hardcoded provider list), capped at 500
13474
+ # results.
13215
13475
  #
13216
- # Raises on 404: Not found
13476
+ # _Requires permission: `resources:read`._
13477
+ #
13478
+ # GET /api/org/{orgId}/log-workspaces/resources
13217
13479
  #
13218
13480
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13219
13481
  # constructed with.
13220
- # @param id [String]
13221
13482
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13222
- # @return [Hash] Parsed JSON, shaped as `MetricAlertRule` — see `sig/infrawrench/sdk.rbs`.
13483
+ # @return [Hash] Parsed JSON, shaped as `LogCapableResourceList` — see
13484
+ # `sig/infrawrench/sdk.rbs`.
13223
13485
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13224
- def get(id:, org_id: nil, request_options: nil)
13486
+ def resources(org_id: nil, request_options: nil)
13225
13487
  @transport.request(
13226
13488
  http_method: "GET",
13227
- path: "/api/org/{orgId}/metric-alerts/{id}",
13228
- path_params: { "orgId" => org_id, "id" => id },
13489
+ path: "/api/org/{orgId}/log-workspaces/resources",
13490
+ path_params: { "orgId" => org_id },
13229
13491
  request_options: request_options
13230
13492
  )
13231
13493
  end
13232
13494
 
13233
- # List metric alert rules with live firing status
13495
+ # Update a saved log query
13234
13496
  #
13235
- # GET /api/org/{orgId}/metric-alerts
13497
+ # Edit the name, resource set, search expression and/or the alert toggle.
13498
+ # Changing the search or the resources resets the alert pass's evaluation
13499
+ # state; turning the alert on makes the query due for evaluation
13500
+ # immediately. Audit-logged.
13501
+ #
13502
+ # _Requires permission: `resources:write`._
13503
+ #
13504
+ # PUT /api/org/{orgId}/log-workspaces/{queryId}
13505
+ #
13506
+ # Raises on 400: Bad request
13507
+ #
13508
+ # Raises on 404: Not found
13509
+ #
13510
+ # Raises on 409: A saved query with this name already exists
13236
13511
  #
13237
13512
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13238
13513
  # constructed with.
13514
+ # @param query_id [String]
13515
+ # @param body [Hash] Request body, shaped as `LogWorkspaceQueryUpdate`.
13239
13516
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13240
- # @return [Array<Hash>] Parsed JSON, shaped as `Array<MetricAlertRuleWithStatus>` — see
13241
- # `sig/infrawrench/sdk.rbs`.
13517
+ # @return [Hash] Parsed JSON, shaped as `LogWorkspaceQuery` — see `sig/infrawrench/sdk.rbs`.
13242
13518
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13243
- def list(org_id: nil, request_options: nil)
13519
+ def update(query_id:, body:, org_id: nil, request_options: nil)
13244
13520
  @transport.request(
13245
- http_method: "GET",
13246
- path: "/api/org/{orgId}/metric-alerts",
13247
- path_params: { "orgId" => org_id },
13521
+ http_method: "PUT",
13522
+ path: "/api/org/{orgId}/log-workspaces/{queryId}",
13523
+ path_params: { "orgId" => org_id, "queryId" => query_id },
13524
+ body: body,
13248
13525
  request_options: request_options
13249
13526
  )
13250
13527
  end
13528
+ end
13251
13529
 
13252
- # List metric series that actually exist
13530
+ # `client.managed_accounts`
13531
+ class ManagedAccountsNamespace
13532
+ # @api private
13533
+ # @param transport [Transport]
13534
+ def initialize(transport)
13535
+ @transport = transport
13536
+ end
13537
+
13538
+ # Create a managed account
13253
13539
  #
13254
- # The series labels resources reported in the last 7 days, optionally
13255
- # narrowed to one plugin and resource type; what the rule builder's metric
13256
- # picker is fed from.
13540
+ # Refused with 409 when a cost centre or account named here is already
13541
+ # billed to another customer. The error names the other customer, because
13542
+ # “it conflicts” without saying with whom sends the caller hunting.
13257
13543
  #
13258
- # GET /api/org/{orgId}/metric-alerts/metric-keys
13544
+ # _Requires permission: `invoices:write`._
13545
+ #
13546
+ # POST /api/org/{orgId}/managed-accounts
13547
+ #
13548
+ # Raises on 400: Bad request
13549
+ #
13550
+ # Raises on 409: Conflict
13259
13551
  #
13260
13552
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13261
13553
  # constructed with.
13262
- # @param plugin_id [String, nil]
13263
- # @param resource_type_id [String, nil]
13554
+ # @param body [Hash] Request body, shaped as `ManagedAccountInput`.
13264
13555
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13265
- # @return [Array<Hash>] Parsed JSON, shaped as `Array<MetricSeriesKey>` — see
13266
- # `sig/infrawrench/sdk.rbs`.
13556
+ # @return [Hash] Parsed JSON, shaped as `ManagedAccount` — see `sig/infrawrench/sdk.rbs`.
13267
13557
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13268
- def metric_keys(org_id: nil, plugin_id: nil, resource_type_id: nil, request_options: nil)
13558
+ def create(body:, org_id: nil, request_options: nil)
13269
13559
  @transport.request(
13270
- http_method: "GET",
13271
- path: "/api/org/{orgId}/metric-alerts/metric-keys",
13560
+ http_method: "POST",
13561
+ path: "/api/org/{orgId}/managed-accounts",
13272
13562
  path_params: { "orgId" => org_id },
13273
- query: { "pluginId" => plugin_id, "resourceTypeId" => resource_type_id },
13563
+ body: body,
13274
13564
  request_options: request_options
13275
13565
  )
13276
13566
  end
13277
13567
 
13278
- # List what the organization's resources offer to select on
13568
+ # Retire a managed account
13279
13569
  #
13280
- # GET /api/org/{orgId}/metric-alerts/selector-options
13570
+ # A soft delete: an issued invoice names its customer, and an invoice whose
13571
+ # customer stopped resolving is exactly the unreconcilable document this
13572
+ # feature exists to prevent. Draft invoices are removed with it; a draft was
13573
+ # never issued.
13574
+ #
13575
+ # _Requires permission: `invoices:write`._
13576
+ #
13577
+ # DELETE /api/org/{orgId}/managed-accounts/{id}
13578
+ #
13579
+ # Raises on 404: Not found
13281
13580
  #
13282
13581
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13283
13582
  # constructed with.
13583
+ # @param id [String]
13284
13584
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13285
- # @return [Hash] Parsed JSON, shaped as `MetricAlertSelectorOptions` — see
13286
- # `sig/infrawrench/sdk.rbs`.
13585
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
13287
13586
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13288
- def selector_options(org_id: nil, request_options: nil)
13587
+ def delete(id:, org_id: nil, request_options: nil)
13289
13588
  @transport.request(
13290
- http_method: "GET",
13291
- path: "/api/org/{orgId}/metric-alerts/selector-options",
13292
- path_params: { "orgId" => org_id },
13589
+ http_method: "DELETE",
13590
+ path: "/api/org/{orgId}/managed-accounts/{id}",
13591
+ path_params: { "orgId" => org_id, "id" => id },
13293
13592
  request_options: request_options
13294
13593
  )
13295
13594
  end
13296
13595
 
13297
- # Preview which resources a selector matches right now
13596
+ # Get a managed account
13298
13597
  #
13299
- # GET /api/org/{orgId}/metric-alerts/selector-preview
13598
+ # _Requires permission: `invoices:read`._
13300
13599
  #
13301
- # Raises on 400: Bad request
13600
+ # GET /api/org/{orgId}/managed-accounts/{id}
13601
+ #
13602
+ # Raises on 404: Not found
13302
13603
  #
13303
13604
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13304
13605
  # constructed with.
13305
- # @param plugin_id [String, nil]
13306
- # @param resource_type_id [String, nil]
13307
- # @param tag_key [String, nil]
13308
- # @param tag_value [String, nil]
13606
+ # @param id [String]
13309
13607
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13310
- # @return [Hash] Parsed JSON, shaped as `MetricAlertSelectorPreview` — see
13311
- # `sig/infrawrench/sdk.rbs`.
13608
+ # @return [Hash] Parsed JSON, shaped as `ManagedAccount` — see `sig/infrawrench/sdk.rbs`.
13312
13609
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13313
- def selector_preview(
13314
- org_id: nil,
13315
- plugin_id: nil,
13316
- resource_type_id: nil,
13317
- tag_key: nil,
13318
- tag_value: nil,
13319
- request_options: nil
13320
- )
13610
+ def get(id:, org_id: nil, request_options: nil)
13321
13611
  @transport.request(
13322
13612
  http_method: "GET",
13323
- path: "/api/org/{orgId}/metric-alerts/selector-preview",
13324
- path_params: { "orgId" => org_id },
13325
- query: {
13326
- "pluginId" => plugin_id,
13327
- "resourceTypeId" => resource_type_id,
13328
- "tagKey" => tag_key,
13329
- "tagValue" => tag_value
13330
- },
13613
+ path: "/api/org/{orgId}/managed-accounts/{id}",
13614
+ path_params: { "orgId" => org_id, "id" => id },
13331
13615
  request_options: request_options
13332
13616
  )
13333
13617
  end
13334
13618
 
13335
- # Update a metric alert rule
13619
+ # List managed accounts
13336
13620
  #
13337
- # PUT /api/org/{orgId}/metric-alerts/{id}
13621
+ # The customers a managed service provider bills. A managed account
13622
+ # references existing cost centres rather than defining its own matching
13623
+ # rules, so the spend on an invoice is the same spend the showback report
13624
+ # attributes to those centres.
13338
13625
  #
13339
- # Raises on 400: Bad request
13626
+ # _Requires permission: `invoices:read`._
13340
13627
  #
13341
- # Raises on 404: Not found
13628
+ # GET /api/org/{orgId}/managed-accounts
13342
13629
  #
13343
13630
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13344
13631
  # constructed with.
13345
- # @param id [String]
13346
- # @param body [Hash] Request body, shaped as `MetricAlertRuleInput`.
13347
13632
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13348
- # @return [Hash] Parsed JSON, shaped as `MetricAlertRule` — see `sig/infrawrench/sdk.rbs`.
13633
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<ManagedAccount>` — see
13634
+ # `sig/infrawrench/sdk.rbs`.
13349
13635
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13350
- def update(id:, body:, org_id: nil, request_options: nil)
13636
+ def list(org_id: nil, request_options: nil)
13351
13637
  @transport.request(
13352
- http_method: "PUT",
13353
- path: "/api/org/{orgId}/metric-alerts/{id}",
13354
- path_params: { "orgId" => org_id, "id" => id },
13355
- body: body,
13638
+ http_method: "GET",
13639
+ path: "/api/org/{orgId}/managed-accounts",
13640
+ path_params: { "orgId" => org_id },
13356
13641
  request_options: request_options
13357
13642
  )
13358
13643
  end
13359
- end
13360
-
13361
- # `client.moment`
13362
- class MomentNamespace
13363
- # @api private
13364
- # @param transport [Transport]
13365
- def initialize(transport)
13366
- @transport = transport
13367
- end
13368
13644
 
13369
- # Everything that happened around a timestamp
13645
+ # Update a managed account
13370
13646
  #
13371
- # "What changed around 03:14?"; one merged, chronological narrative of
13372
- # everything the platform knows happened in a window: resource changes
13373
- # (including sleep/wake schedule attribution), provider status incidents
13374
- # that started/resolved in or overlap the window, cost anomalies, workflow
13375
- # runs, deployments, audit-log entries, change freezes, and the drift/expiry
13376
- # alert deliveries. Each feed is gated on the same permission its own
13377
- # endpoint requires; feeds the caller cannot read are reported as `omitted`,
13378
- # and a feed whose query fails is reported as `error` without blanking the
13379
- # rest of the response.
13647
+ # A full replace. Editing the scope changes what **future** drafts are drawn
13648
+ # over and nothing else: every approved invoice holds its own copy of the
13649
+ # scope, so moving a cost centre between customers cannot re-bill a period
13650
+ # that has already been invoiced.
13380
13651
  #
13381
- # _Requires permission: `resources:read`._
13652
+ # _Requires permission: `invoices:write`._
13382
13653
  #
13383
- # GET /api/org/{orgId}/moment
13654
+ # PUT /api/org/{orgId}/managed-accounts/{id}
13384
13655
  #
13385
13656
  # Raises on 400: Bad request
13386
13657
  #
13658
+ # Raises on 404: Not found
13659
+ #
13660
+ # Raises on 409: Conflict
13661
+ #
13387
13662
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13388
13663
  # constructed with.
13389
- # @param at [String, nil] Centre of the window. Defaults to now.
13390
- # @param window [Integer, nil] Half-window in minutes (the ± around `at`). Default 60, max
13391
- # 4320 (±3 days).
13664
+ # @param id [String]
13665
+ # @param body [Hash] Request body, shaped as `ManagedAccountInput`.
13392
13666
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13393
- # @return [Hash] Parsed JSON, shaped as `MomentResponse` — see `sig/infrawrench/sdk.rbs`.
13667
+ # @return [Hash] Parsed JSON, shaped as `ManagedAccount` — see `sig/infrawrench/sdk.rbs`.
13394
13668
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13395
- def get(org_id: nil, at: nil, window: nil, request_options: nil)
13669
+ def update(id:, body:, org_id: nil, request_options: nil)
13396
13670
  @transport.request(
13397
- http_method: "GET",
13398
- path: "/api/org/{orgId}/moment",
13399
- path_params: { "orgId" => org_id },
13400
- query: { "at" => at, "window" => window },
13671
+ http_method: "PUT",
13672
+ path: "/api/org/{orgId}/managed-accounts/{id}",
13673
+ path_params: { "orgId" => org_id, "id" => id },
13674
+ body: body,
13401
13675
  request_options: request_options
13402
13676
  )
13403
13677
  end
13404
13678
  end
13405
13679
 
13406
- # `client.msteams.webhooks`
13407
- class MsteamsWebhooksNamespace
13680
+ # `client.metric_alerts`
13681
+ class MetricAlertsNamespace
13408
13682
  # @api private
13409
13683
  # @param transport [Transport]
13410
13684
  def initialize(transport)
13411
13685
  @transport = transport
13412
13686
  end
13413
13687
 
13414
- # Connect a Teams channel as an alert destination
13688
+ # Create a metric alert rule
13415
13689
  #
13416
- # Adds a channel by webhook URL, or updates the one already holding that
13417
- # URL. Which alerts reach it is decided by /alert-rules; connecting a
13418
- # channel routes nothing to it on its own. Responds 400 when the URL is not
13419
- # https or its host is not Microsoft-operated.
13690
+ # Rules select resources by query (plugin + resource type + tag), never by
13691
+ # id list, so a rule automatically covers resources created after it was
13692
+ # written. The poller evaluates enabled rules about once a minute and alerts
13693
+ # when the condition held for the whole trailing window.
13420
13694
  #
13421
- # POST /api/org/{orgId}/msteams/webhooks
13695
+ # POST /api/org/{orgId}/metric-alerts
13422
13696
  #
13423
13697
  # Raises on 400: Bad request
13424
13698
  #
13425
13699
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13426
13700
  # constructed with.
13427
- # @param body [Hash, nil] Request body, shaped as `MsTeamsWebhookCreate`.
13701
+ # @param body [Hash] Request body, shaped as `MetricAlertRuleInput`.
13428
13702
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13429
- # @return [Hash] Parsed JSON, shaped as `MsTeamsWebhook` — see `sig/infrawrench/sdk.rbs`.
13703
+ # @return [Hash] Parsed JSON, shaped as `MetricAlertRule` — see `sig/infrawrench/sdk.rbs`.
13430
13704
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13431
- def create(org_id: nil, body: nil, request_options: nil)
13705
+ def create(body:, org_id: nil, request_options: nil)
13432
13706
  @transport.request(
13433
13707
  http_method: "POST",
13434
- path: "/api/org/{orgId}/msteams/webhooks",
13708
+ path: "/api/org/{orgId}/metric-alerts",
13435
13709
  path_params: { "orgId" => org_id },
13436
13710
  body: body,
13437
13711
  request_options: request_options
13438
13712
  )
13439
13713
  end
13440
13714
 
13441
- # Disconnect a Teams channel
13715
+ # Delete a metric alert rule
13442
13716
  #
13443
- # DELETE /api/org/{orgId}/msteams/webhooks/{id}
13717
+ # Soft delete. The rule's firing history stays readable via
13718
+ # /metric-alerts/events.
13719
+ #
13720
+ # DELETE /api/org/{orgId}/metric-alerts/{id}
13444
13721
  #
13445
13722
  # Raises on 404: Not found
13446
13723
  #
@@ -13453,247 +13730,519 @@ module Infrawrench
13453
13730
  def delete(id:, org_id: nil, request_options: nil)
13454
13731
  @transport.request(
13455
13732
  http_method: "DELETE",
13456
- path: "/api/org/{orgId}/msteams/webhooks/{id}",
13733
+ path: "/api/org/{orgId}/metric-alerts/{id}",
13457
13734
  path_params: { "orgId" => org_id, "id" => id },
13458
13735
  request_options: request_options
13459
13736
  )
13460
13737
  end
13461
13738
 
13462
- # Rename a Teams channel
13463
- #
13464
- # The webhook URL is immutable; remove the channel and re-add it to change
13465
- # it.
13466
- #
13467
- # PATCH /api/org/{orgId}/msteams/webhooks/{id}
13468
- #
13469
- # Raises on 400: Bad request
13739
+ # Recent metric alert firings
13470
13740
  #
13471
- # Raises on 404: Not found
13741
+ # GET /api/org/{orgId}/metric-alerts/events
13472
13742
  #
13473
13743
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13474
13744
  # constructed with.
13475
- # @param id [String]
13476
- # @param body [Hash, nil] Request body, shaped as `MsTeamsWebhookUpdate`.
13745
+ # @param rule_id [String, nil]
13746
+ # @param limit [Integer, nil]
13477
13747
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13478
- # @return [Hash] Parsed JSON, shaped as `MsTeamsWebhook` — see `sig/infrawrench/sdk.rbs`.
13748
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<MetricAlertEvent>` — see
13749
+ # `sig/infrawrench/sdk.rbs`.
13479
13750
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13480
- def update(id:, org_id: nil, body: nil, request_options: nil)
13751
+ def events(org_id: nil, rule_id: nil, limit: nil, request_options: nil)
13481
13752
  @transport.request(
13482
- http_method: "PATCH",
13483
- path: "/api/org/{orgId}/msteams/webhooks/{id}",
13484
- path_params: { "orgId" => org_id, "id" => id },
13485
- body: body,
13753
+ http_method: "GET",
13754
+ path: "/api/org/{orgId}/metric-alerts/events",
13755
+ path_params: { "orgId" => org_id },
13756
+ query: { "ruleId" => rule_id, "limit" => limit },
13486
13757
  request_options: request_options
13487
13758
  )
13488
13759
  end
13489
- end
13490
13760
 
13491
- # `client.msteams`
13492
- class MsteamsNamespace
13493
- # @return [MsteamsWebhooksNamespace] `client.msteams.webhooks`
13494
- attr_reader :webhooks
13495
-
13496
- # @api private
13497
- # @param transport [Transport]
13498
- def initialize(transport)
13499
- @transport = transport
13500
- @webhooks = MsteamsWebhooksNamespace.new(@transport)
13761
+ # Get a metric alert rule
13762
+ #
13763
+ # GET /api/org/{orgId}/metric-alerts/{id}
13764
+ #
13765
+ # Raises on 404: Not found
13766
+ #
13767
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13768
+ # constructed with.
13769
+ # @param id [String]
13770
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13771
+ # @return [Hash] Parsed JSON, shaped as `MetricAlertRule` — see `sig/infrawrench/sdk.rbs`.
13772
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
13773
+ def get(id:, org_id: nil, request_options: nil)
13774
+ @transport.request(
13775
+ http_method: "GET",
13776
+ path: "/api/org/{orgId}/metric-alerts/{id}",
13777
+ path_params: { "orgId" => org_id, "id" => id },
13778
+ request_options: request_options
13779
+ )
13501
13780
  end
13502
13781
 
13503
- # List the organization's Teams channels
13504
- #
13505
- # Returns the Teams channels alerts can be routed to. Which alerts reach
13506
- # each one is decided by /alert-rules. Webhook URLs are never included.
13782
+ # List metric alert rules with live firing status
13507
13783
  #
13508
- # GET /api/org/{orgId}/msteams/status
13784
+ # GET /api/org/{orgId}/metric-alerts
13509
13785
  #
13510
13786
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13511
13787
  # constructed with.
13512
13788
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13513
- # @return [Hash] Parsed JSON, shaped as `MsTeamsStatus` — see `sig/infrawrench/sdk.rbs`.
13789
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<MetricAlertRuleWithStatus>` — see
13790
+ # `sig/infrawrench/sdk.rbs`.
13514
13791
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13515
- def status(org_id: nil, request_options: nil)
13792
+ def list(org_id: nil, request_options: nil)
13516
13793
  @transport.request(
13517
13794
  http_method: "GET",
13518
- path: "/api/org/{orgId}/msteams/status",
13795
+ path: "/api/org/{orgId}/metric-alerts",
13519
13796
  path_params: { "orgId" => org_id },
13520
13797
  request_options: request_options
13521
13798
  )
13522
13799
  end
13523
13800
 
13524
- # Post a test card to every configured Teams channel
13525
- #
13526
- # Ignores routing rules; every channel gets the test. Fails with the error
13527
- # Microsoft returned when nothing could be delivered (HTTP 404 usually means
13528
- # the Workflow was deleted or turned off).
13801
+ # List metric series that actually exist
13529
13802
  #
13530
- # POST /api/org/{orgId}/msteams/test
13803
+ # The series labels resources reported in the last 7 days, optionally
13804
+ # narrowed to one plugin and resource type; what the rule builder's metric
13805
+ # picker is fed from.
13531
13806
  #
13532
- # Raises on 400: Bad request
13807
+ # GET /api/org/{orgId}/metric-alerts/metric-keys
13533
13808
  #
13534
13809
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13535
13810
  # constructed with.
13811
+ # @param plugin_id [String, nil]
13812
+ # @param resource_type_id [String, nil]
13536
13813
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13537
- # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
13814
+ # @return [Array<Hash>] Parsed JSON, shaped as `Array<MetricSeriesKey>` — see
13815
+ # `sig/infrawrench/sdk.rbs`.
13538
13816
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13539
- def test(org_id: nil, request_options: nil)
13817
+ def metric_keys(org_id: nil, plugin_id: nil, resource_type_id: nil, request_options: nil)
13540
13818
  @transport.request(
13541
- http_method: "POST",
13542
- path: "/api/org/{orgId}/msteams/test",
13819
+ http_method: "GET",
13820
+ path: "/api/org/{orgId}/metric-alerts/metric-keys",
13543
13821
  path_params: { "orgId" => org_id },
13822
+ query: { "pluginId" => plugin_id, "resourceTypeId" => resource_type_id },
13544
13823
  request_options: request_options
13545
13824
  )
13546
13825
  end
13547
- end
13548
13826
 
13549
- # `client.network_flows.kubernetes.settings`
13550
- class NetworkFlowsKubernetesSettingsNamespace
13551
- # @api private
13552
- # @param transport [Transport]
13553
- def initialize(transport)
13554
- @transport = transport
13827
+ # List what the organization's resources offer to select on
13828
+ #
13829
+ # GET /api/org/{orgId}/metric-alerts/selector-options
13830
+ #
13831
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13832
+ # constructed with.
13833
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13834
+ # @return [Hash] Parsed JSON, shaped as `MetricAlertSelectorOptions` — see
13835
+ # `sig/infrawrench/sdk.rbs`.
13836
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
13837
+ def selector_options(org_id: nil, request_options: nil)
13838
+ @transport.request(
13839
+ http_method: "GET",
13840
+ path: "/api/org/{orgId}/metric-alerts/selector-options",
13841
+ path_params: { "orgId" => org_id },
13842
+ request_options: request_options
13843
+ )
13555
13844
  end
13556
13845
 
13557
- # Read a cluster's network cost settings
13558
- #
13559
- # _Requires permission: `costs:read`._
13846
+ # Preview which resources a selector matches right now
13560
13847
  #
13561
- # GET /api/org/{orgId}/network-flows/kubernetes/{accountId}/settings
13848
+ # GET /api/org/{orgId}/metric-alerts/selector-preview
13562
13849
  #
13563
- # Raises on 404: Not found
13850
+ # Raises on 400: Bad request
13564
13851
  #
13565
- # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
13566
- # @param account_id [String]
13852
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13853
+ # constructed with.
13854
+ # @param plugin_id [String, nil]
13855
+ # @param resource_type_id [String, nil]
13856
+ # @param tag_key [String, nil]
13857
+ # @param tag_value [String, nil]
13567
13858
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13568
- # @return [Hash] Parsed JSON, shaped as `KubernetesNetworkSettings` — see
13859
+ # @return [Hash] Parsed JSON, shaped as `MetricAlertSelectorPreview` — see
13569
13860
  # `sig/infrawrench/sdk.rbs`.
13570
13861
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13571
- def get(account_id:, org_id: nil, request_options: nil)
13862
+ def selector_preview(
13863
+ org_id: nil,
13864
+ plugin_id: nil,
13865
+ resource_type_id: nil,
13866
+ tag_key: nil,
13867
+ tag_value: nil,
13868
+ request_options: nil
13869
+ )
13572
13870
  @transport.request(
13573
13871
  http_method: "GET",
13574
- path: "/api/org/{orgId}/network-flows/kubernetes/{accountId}/settings",
13575
- path_params: { "orgId" => org_id, "accountId" => account_id },
13872
+ path: "/api/org/{orgId}/metric-alerts/selector-preview",
13873
+ path_params: { "orgId" => org_id },
13874
+ query: {
13875
+ "pluginId" => plugin_id,
13876
+ "resourceTypeId" => resource_type_id,
13877
+ "tagKey" => tag_key,
13878
+ "tagValue" => tag_value
13879
+ },
13576
13880
  request_options: request_options
13577
13881
  )
13578
13882
  end
13579
13883
 
13580
- # Set the billed data-transfer source for a cluster
13581
- #
13582
- # Say which billed cost rows are this cluster's data transfer, in the cost
13583
- # query language. An empty or null query clears it. A query that narrows
13584
- # nothing is refused: it would apportion the whole bill across one cluster.
13585
- #
13586
- # _Requires permission: `costs:write`._
13884
+ # Update a metric alert rule
13587
13885
  #
13588
- # PUT /api/org/{orgId}/network-flows/kubernetes/{accountId}/settings
13886
+ # PUT /api/org/{orgId}/metric-alerts/{id}
13589
13887
  #
13590
13888
  # Raises on 400: Bad request
13591
13889
  #
13592
- # Raises on 403: Forbidden
13593
- #
13594
13890
  # Raises on 404: Not found
13595
13891
  #
13596
- # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
13597
- # @param account_id [String]
13598
- # @param body [Hash] Request body, shaped as `Hash`.
13892
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13893
+ # constructed with.
13894
+ # @param id [String]
13895
+ # @param body [Hash] Request body, shaped as `MetricAlertRuleInput`.
13599
13896
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13600
- # @return [Hash] Parsed JSON, shaped as `KubernetesNetworkSettings` — see
13601
- # `sig/infrawrench/sdk.rbs`.
13897
+ # @return [Hash] Parsed JSON, shaped as `MetricAlertRule` — see `sig/infrawrench/sdk.rbs`.
13602
13898
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13603
- def update(account_id:, body:, org_id: nil, request_options: nil)
13899
+ def update(id:, body:, org_id: nil, request_options: nil)
13604
13900
  @transport.request(
13605
13901
  http_method: "PUT",
13606
- path: "/api/org/{orgId}/network-flows/kubernetes/{accountId}/settings",
13607
- path_params: { "orgId" => org_id, "accountId" => account_id },
13902
+ path: "/api/org/{orgId}/metric-alerts/{id}",
13903
+ path_params: { "orgId" => org_id, "id" => id },
13608
13904
  body: body,
13609
13905
  request_options: request_options
13610
13906
  )
13611
13907
  end
13612
13908
  end
13613
13909
 
13614
- # `client.network_flows.kubernetes`
13615
- class NetworkFlowsKubernetesNamespace
13616
- # @return [NetworkFlowsKubernetesSettingsNamespace] `client.network_flows.kubernetes.settings`
13617
- attr_reader :settings
13618
-
13910
+ # `client.moment`
13911
+ class MomentNamespace
13619
13912
  # @api private
13620
13913
  # @param transport [Transport]
13621
13914
  def initialize(transport)
13622
13915
  @transport = transport
13623
- @settings = NetworkFlowsKubernetesSettingsNamespace.new(@transport)
13624
13916
  end
13625
13917
 
13626
- # Kubernetes network costs for one cluster
13627
- #
13628
- # Pod-level network attribution for a Kubernetes account: bytes by
13629
- # namespace, workload and boundary (same zone, cross-zone, cross-region,
13630
- # internet), the largest workload → peer pairs, and which sources the
13631
- # figures came from.
13918
+ # Everything that happened around a timestamp
13632
13919
  #
13633
- # `estimatedCost` is bytes at the published rate of the cloud the nodes run
13634
- # on, with any per-cluster overrides from the account's rates field. When a
13635
- # billed source is configured (`PUT .../settings`), `allocatedCost`
13636
- # apportions that real billed spend across the rows day by day, never
13637
- # handing out more than was billed; the rest is `unallocatedCost`.
13920
+ # "What changed around 03:14?"; one merged, chronological narrative of
13921
+ # everything the platform knows happened in a window: resource changes
13922
+ # (including sleep/wake schedule attribution), provider status incidents
13923
+ # that started/resolved in or overlap the window, cost anomalies, workflow
13924
+ # runs, deployments, audit-log entries, change freezes, and the drift/expiry
13925
+ # alert deliveries. Each feed is gated on the same permission its own
13926
+ # endpoint requires; feeds the caller cannot read are reported as `omitted`,
13927
+ # and a feed whose query fails is reported as `error` without blanking the
13928
+ # rest of the response.
13638
13929
  #
13639
- # _Requires permission: `costs:read`._
13930
+ # _Requires permission: `resources:read`._
13640
13931
  #
13641
- # GET /api/org/{orgId}/network-flows/kubernetes/{accountId}
13932
+ # GET /api/org/{orgId}/moment
13642
13933
  #
13643
13934
  # Raises on 400: Bad request
13644
13935
  #
13645
- # Raises on 404: Not found
13646
- #
13647
- # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
13648
- # @param account_id [String]
13649
- # @param from [String, nil] Inclusive start day. Defaults to 13 days ago.
13650
- # @param to [String, nil] Inclusive end day. Defaults to today.
13651
- # @param limit [Integer, nil] Pairs to return in `topTalkers`. Defaults to 25.
13936
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13937
+ # constructed with.
13938
+ # @param at [String, nil] Centre of the window. Defaults to now.
13939
+ # @param window [Integer, nil] Half-window in minutes (the ± around `at`). Default 60, max
13940
+ # 4320 (±3 days).
13652
13941
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13653
- # @return [Hash] Parsed JSON, shaped as `KubernetesNetworkReport` — see
13654
- # `sig/infrawrench/sdk.rbs`.
13942
+ # @return [Hash] Parsed JSON, shaped as `MomentResponse` — see `sig/infrawrench/sdk.rbs`.
13655
13943
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13656
- def get(account_id:, org_id: nil, from: nil, to: nil, limit: nil, request_options: nil)
13944
+ def get(org_id: nil, at: nil, window: nil, request_options: nil)
13657
13945
  @transport.request(
13658
13946
  http_method: "GET",
13659
- path: "/api/org/{orgId}/network-flows/kubernetes/{accountId}",
13660
- path_params: { "orgId" => org_id, "accountId" => account_id },
13661
- query: { "from" => from, "to" => to, "limit" => limit },
13947
+ path: "/api/org/{orgId}/moment",
13948
+ path_params: { "orgId" => org_id },
13949
+ query: { "at" => at, "window" => window },
13662
13950
  request_options: request_options
13663
13951
  )
13664
13952
  end
13665
13953
  end
13666
13954
 
13667
- # `client.network_flows.settings`
13668
- class NetworkFlowsSettingsNamespace
13955
+ # `client.msteams.webhooks`
13956
+ class MsteamsWebhooksNamespace
13669
13957
  # @api private
13670
13958
  # @param transport [Transport]
13671
13959
  def initialize(transport)
13672
13960
  @transport = transport
13673
13961
  end
13674
13962
 
13675
- # Read the network flow collection switch
13963
+ # Connect a Teams channel as an alert destination
13676
13964
  #
13677
- # _Requires permission: `costs:read`._
13965
+ # Adds a channel by webhook URL, or updates the one already holding that
13966
+ # URL. Which alerts reach it is decided by /alert-rules; connecting a
13967
+ # channel routes nothing to it on its own. Responds 400 when the URL is not
13968
+ # https or its host is not Microsoft-operated.
13678
13969
  #
13679
- # GET /api/org/{orgId}/network-flows/settings
13970
+ # POST /api/org/{orgId}/msteams/webhooks
13971
+ #
13972
+ # Raises on 400: Bad request
13680
13973
  #
13681
13974
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13682
13975
  # constructed with.
13976
+ # @param body [Hash, nil] Request body, shaped as `MsTeamsWebhookCreate`.
13683
13977
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
13684
- # @return [Hash] Parsed JSON, shaped as `NetworkFlowSettings` — see
13685
- # `sig/infrawrench/sdk.rbs`.
13978
+ # @return [Hash] Parsed JSON, shaped as `MsTeamsWebhook` — see `sig/infrawrench/sdk.rbs`.
13686
13979
  # @raise [Infrawrench::ApiError] On any non-2xx response.
13687
- def get(org_id: nil, request_options: nil)
13980
+ def create(org_id: nil, body: nil, request_options: nil)
13688
13981
  @transport.request(
13689
- http_method: "GET",
13690
- path: "/api/org/{orgId}/network-flows/settings",
13982
+ http_method: "POST",
13983
+ path: "/api/org/{orgId}/msteams/webhooks",
13691
13984
  path_params: { "orgId" => org_id },
13985
+ body: body,
13692
13986
  request_options: request_options
13693
13987
  )
13694
13988
  end
13695
13989
 
13696
- # Turn network flow collection on or off
13990
+ # Disconnect a Teams channel
13991
+ #
13992
+ # DELETE /api/org/{orgId}/msteams/webhooks/{id}
13993
+ #
13994
+ # Raises on 404: Not found
13995
+ #
13996
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
13997
+ # constructed with.
13998
+ # @param id [String]
13999
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14000
+ # @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
14001
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14002
+ def delete(id:, org_id: nil, request_options: nil)
14003
+ @transport.request(
14004
+ http_method: "DELETE",
14005
+ path: "/api/org/{orgId}/msteams/webhooks/{id}",
14006
+ path_params: { "orgId" => org_id, "id" => id },
14007
+ request_options: request_options
14008
+ )
14009
+ end
14010
+
14011
+ # Rename a Teams channel
14012
+ #
14013
+ # The webhook URL is immutable; remove the channel and re-add it to change
14014
+ # it.
14015
+ #
14016
+ # PATCH /api/org/{orgId}/msteams/webhooks/{id}
14017
+ #
14018
+ # Raises on 400: Bad request
14019
+ #
14020
+ # Raises on 404: Not found
14021
+ #
14022
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14023
+ # constructed with.
14024
+ # @param id [String]
14025
+ # @param body [Hash, nil] Request body, shaped as `MsTeamsWebhookUpdate`.
14026
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14027
+ # @return [Hash] Parsed JSON, shaped as `MsTeamsWebhook` — see `sig/infrawrench/sdk.rbs`.
14028
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14029
+ def update(id:, org_id: nil, body: nil, request_options: nil)
14030
+ @transport.request(
14031
+ http_method: "PATCH",
14032
+ path: "/api/org/{orgId}/msteams/webhooks/{id}",
14033
+ path_params: { "orgId" => org_id, "id" => id },
14034
+ body: body,
14035
+ request_options: request_options
14036
+ )
14037
+ end
14038
+ end
14039
+
14040
+ # `client.msteams`
14041
+ class MsteamsNamespace
14042
+ # @return [MsteamsWebhooksNamespace] `client.msteams.webhooks`
14043
+ attr_reader :webhooks
14044
+
14045
+ # @api private
14046
+ # @param transport [Transport]
14047
+ def initialize(transport)
14048
+ @transport = transport
14049
+ @webhooks = MsteamsWebhooksNamespace.new(@transport)
14050
+ end
14051
+
14052
+ # List the organization's Teams channels
14053
+ #
14054
+ # Returns the Teams channels alerts can be routed to. Which alerts reach
14055
+ # each one is decided by /alert-rules. Webhook URLs are never included.
14056
+ #
14057
+ # GET /api/org/{orgId}/msteams/status
14058
+ #
14059
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14060
+ # constructed with.
14061
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14062
+ # @return [Hash] Parsed JSON, shaped as `MsTeamsStatus` — see `sig/infrawrench/sdk.rbs`.
14063
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14064
+ def status(org_id: nil, request_options: nil)
14065
+ @transport.request(
14066
+ http_method: "GET",
14067
+ path: "/api/org/{orgId}/msteams/status",
14068
+ path_params: { "orgId" => org_id },
14069
+ request_options: request_options
14070
+ )
14071
+ end
14072
+
14073
+ # Post a test card to every configured Teams channel
14074
+ #
14075
+ # Ignores routing rules; every channel gets the test. Fails with the error
14076
+ # Microsoft returned when nothing could be delivered (HTTP 404 usually means
14077
+ # the Workflow was deleted or turned off).
14078
+ #
14079
+ # POST /api/org/{orgId}/msteams/test
14080
+ #
14081
+ # Raises on 400: Bad request
14082
+ #
14083
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14084
+ # constructed with.
14085
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14086
+ # @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
14087
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14088
+ def test(org_id: nil, request_options: nil)
14089
+ @transport.request(
14090
+ http_method: "POST",
14091
+ path: "/api/org/{orgId}/msteams/test",
14092
+ path_params: { "orgId" => org_id },
14093
+ request_options: request_options
14094
+ )
14095
+ end
14096
+ end
14097
+
14098
+ # `client.network_flows.kubernetes.settings`
14099
+ class NetworkFlowsKubernetesSettingsNamespace
14100
+ # @api private
14101
+ # @param transport [Transport]
14102
+ def initialize(transport)
14103
+ @transport = transport
14104
+ end
14105
+
14106
+ # Read a cluster's network cost settings
14107
+ #
14108
+ # _Requires permission: `costs:read`._
14109
+ #
14110
+ # GET /api/org/{orgId}/network-flows/kubernetes/{accountId}/settings
14111
+ #
14112
+ # Raises on 404: Not found
14113
+ #
14114
+ # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
14115
+ # @param account_id [String]
14116
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14117
+ # @return [Hash] Parsed JSON, shaped as `KubernetesNetworkSettings` — see
14118
+ # `sig/infrawrench/sdk.rbs`.
14119
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14120
+ def get(account_id:, org_id: nil, request_options: nil)
14121
+ @transport.request(
14122
+ http_method: "GET",
14123
+ path: "/api/org/{orgId}/network-flows/kubernetes/{accountId}/settings",
14124
+ path_params: { "orgId" => org_id, "accountId" => account_id },
14125
+ request_options: request_options
14126
+ )
14127
+ end
14128
+
14129
+ # Set the billed data-transfer source for a cluster
14130
+ #
14131
+ # Say which billed cost rows are this cluster's data transfer, in the cost
14132
+ # query language. An empty or null query clears it. A query that narrows
14133
+ # nothing is refused: it would apportion the whole bill across one cluster.
14134
+ #
14135
+ # _Requires permission: `costs:write`._
14136
+ #
14137
+ # PUT /api/org/{orgId}/network-flows/kubernetes/{accountId}/settings
14138
+ #
14139
+ # Raises on 400: Bad request
14140
+ #
14141
+ # Raises on 403: Forbidden
14142
+ #
14143
+ # Raises on 404: Not found
14144
+ #
14145
+ # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
14146
+ # @param account_id [String]
14147
+ # @param body [Hash] Request body, shaped as `Hash`.
14148
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14149
+ # @return [Hash] Parsed JSON, shaped as `KubernetesNetworkSettings` — see
14150
+ # `sig/infrawrench/sdk.rbs`.
14151
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14152
+ def update(account_id:, body:, org_id: nil, request_options: nil)
14153
+ @transport.request(
14154
+ http_method: "PUT",
14155
+ path: "/api/org/{orgId}/network-flows/kubernetes/{accountId}/settings",
14156
+ path_params: { "orgId" => org_id, "accountId" => account_id },
14157
+ body: body,
14158
+ request_options: request_options
14159
+ )
14160
+ end
14161
+ end
14162
+
14163
+ # `client.network_flows.kubernetes`
14164
+ class NetworkFlowsKubernetesNamespace
14165
+ # @return [NetworkFlowsKubernetesSettingsNamespace] `client.network_flows.kubernetes.settings`
14166
+ attr_reader :settings
14167
+
14168
+ # @api private
14169
+ # @param transport [Transport]
14170
+ def initialize(transport)
14171
+ @transport = transport
14172
+ @settings = NetworkFlowsKubernetesSettingsNamespace.new(@transport)
14173
+ end
14174
+
14175
+ # Kubernetes network costs for one cluster
14176
+ #
14177
+ # Pod-level network attribution for a Kubernetes account: bytes by
14178
+ # namespace, workload and boundary (same zone, cross-zone, cross-region,
14179
+ # internet), the largest workload → peer pairs, and which sources the
14180
+ # figures came from.
14181
+ #
14182
+ # `estimatedCost` is bytes at the published rate of the cloud the nodes run
14183
+ # on, with any per-cluster overrides from the account's rates field. When a
14184
+ # billed source is configured (`PUT .../settings`), `allocatedCost`
14185
+ # apportions that real billed spend across the rows day by day, never
14186
+ # handing out more than was billed; the rest is `unallocatedCost`.
14187
+ #
14188
+ # _Requires permission: `costs:read`._
14189
+ #
14190
+ # GET /api/org/{orgId}/network-flows/kubernetes/{accountId}
14191
+ #
14192
+ # Raises on 400: Bad request
14193
+ #
14194
+ # Raises on 404: Not found
14195
+ #
14196
+ # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
14197
+ # @param account_id [String]
14198
+ # @param from [String, nil] Inclusive start day. Defaults to 13 days ago.
14199
+ # @param to [String, nil] Inclusive end day. Defaults to today.
14200
+ # @param limit [Integer, nil] Pairs to return in `topTalkers`. Defaults to 25.
14201
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14202
+ # @return [Hash] Parsed JSON, shaped as `KubernetesNetworkReport` — see
14203
+ # `sig/infrawrench/sdk.rbs`.
14204
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14205
+ def get(account_id:, org_id: nil, from: nil, to: nil, limit: nil, request_options: nil)
14206
+ @transport.request(
14207
+ http_method: "GET",
14208
+ path: "/api/org/{orgId}/network-flows/kubernetes/{accountId}",
14209
+ path_params: { "orgId" => org_id, "accountId" => account_id },
14210
+ query: { "from" => from, "to" => to, "limit" => limit },
14211
+ request_options: request_options
14212
+ )
14213
+ end
14214
+ end
14215
+
14216
+ # `client.network_flows.settings`
14217
+ class NetworkFlowsSettingsNamespace
14218
+ # @api private
14219
+ # @param transport [Transport]
14220
+ def initialize(transport)
14221
+ @transport = transport
14222
+ end
14223
+
14224
+ # Read the network flow collection switch
14225
+ #
14226
+ # _Requires permission: `costs:read`._
14227
+ #
14228
+ # GET /api/org/{orgId}/network-flows/settings
14229
+ #
14230
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14231
+ # constructed with.
14232
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14233
+ # @return [Hash] Parsed JSON, shaped as `NetworkFlowSettings` — see
14234
+ # `sig/infrawrench/sdk.rbs`.
14235
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14236
+ def get(org_id: nil, request_options: nil)
14237
+ @transport.request(
14238
+ http_method: "GET",
14239
+ path: "/api/org/{orgId}/network-flows/settings",
14240
+ path_params: { "orgId" => org_id },
14241
+ request_options: request_options
14242
+ )
14243
+ end
14244
+
14245
+ # Turn network flow collection on or off
13697
14246
  #
13698
14247
  # Collection is **off by default**. Enabling it authorizes Infrawrench to
13699
14248
  # run daily queries against the provider's log store; and on AWS those
@@ -14130,241 +14679,694 @@ module Infrawrench
14130
14679
  # @return [Hash] Parsed JSON, shaped as `OrphanListResponse` — see
14131
14680
  # `sig/infrawrench/sdk.rbs`.
14132
14681
  # @raise [Infrawrench::ApiError] On any non-2xx response.
14133
- def get(org_id: nil, request_options: nil)
14682
+ def get(org_id: nil, request_options: nil)
14683
+ @transport.request(
14684
+ http_method: "GET",
14685
+ path: "/api/org/{orgId}/orphans",
14686
+ path_params: { "orgId" => org_id },
14687
+ request_options: request_options
14688
+ )
14689
+ end
14690
+ end
14691
+
14692
+ # `client.ownership`
14693
+ class OwnershipNamespace
14694
+ # @api private
14695
+ # @param transport [Transport]
14696
+ def initialize(transport)
14697
+ @transport = transport
14698
+ end
14699
+
14700
+ # Clear a resource's ownership
14701
+ #
14702
+ # Removes the ownership record. The resource itself is untouched.
14703
+ #
14704
+ # _Requires permission: `resources:write`._
14705
+ #
14706
+ # DELETE /api/org/{orgId}/ownership
14707
+ #
14708
+ # Raises on 400: Bad request
14709
+ #
14710
+ # Raises on 404: Not found
14711
+ #
14712
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14713
+ # constructed with.
14714
+ # @param resource_id [String]
14715
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14716
+ # @return [nil] This endpoint returns no content.
14717
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14718
+ def delete(resource_id:, org_id: nil, request_options: nil)
14719
+ @transport.request(
14720
+ http_method: "DELETE",
14721
+ path: "/api/org/{orgId}/ownership",
14722
+ path_params: { "orgId" => org_id },
14723
+ query: { "resourceId" => resource_id },
14724
+ accept: :empty,
14725
+ request_options: request_options
14726
+ )
14727
+ end
14728
+
14729
+ # List resource ownership records
14730
+ #
14731
+ # Every ownership record in the organization; owner, purpose and authorizing
14732
+ # ticket, per resource. Only resources somebody has recorded something about
14733
+ # appear; an absent record means the resource is unowned.
14734
+ #
14735
+ # _Requires permission: `resources:read`._
14736
+ #
14737
+ # GET /api/org/{orgId}/ownership
14738
+ #
14739
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14740
+ # constructed with.
14741
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14742
+ # @return [Hash] Parsed JSON, shaped as `ResourceOwnershipListResponse` — see
14743
+ # `sig/infrawrench/sdk.rbs`.
14744
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14745
+ def get(org_id: nil, request_options: nil)
14746
+ @transport.request(
14747
+ http_method: "GET",
14748
+ path: "/api/org/{orgId}/ownership",
14749
+ path_params: { "orgId" => org_id },
14750
+ request_options: request_options
14751
+ )
14752
+ end
14753
+
14754
+ # List people an owner can be set to
14755
+ #
14756
+ # Org members, as a minimal id/name/email projection for the owner picker.
14757
+ # Requires only `resources:read`, deliberately not `team:read`: recording
14758
+ # who owns a resource must not be reserved for whoever can also read roles
14759
+ # and membership.
14760
+ #
14761
+ # _Requires permission: `resources:read`._
14762
+ #
14763
+ # GET /api/org/{orgId}/ownership/members
14764
+ #
14765
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14766
+ # constructed with.
14767
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14768
+ # @return [Hash] Parsed JSON, shaped as `OwnerCandidateListResponse` — see
14769
+ # `sig/infrawrench/sdk.rbs`.
14770
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14771
+ def members(org_id: nil, request_options: nil)
14772
+ @transport.request(
14773
+ http_method: "GET",
14774
+ path: "/api/org/{orgId}/ownership/members",
14775
+ path_params: { "orgId" => org_id },
14776
+ request_options: request_options
14777
+ )
14778
+ end
14779
+
14780
+ # Get one resource's ownership
14781
+ #
14782
+ # The ownership record for a single resource, or null when none is recorded.
14783
+ #
14784
+ # _Requires permission: `resources:read`._
14785
+ #
14786
+ # GET /api/org/{orgId}/ownership/resource
14787
+ #
14788
+ # Raises on 400: Bad request
14789
+ #
14790
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14791
+ # constructed with.
14792
+ # @param resource_id [String]
14793
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14794
+ # @return [Hash] Parsed JSON, shaped as `ResourceOwnershipEnvelope` — see
14795
+ # `sig/infrawrench/sdk.rbs`.
14796
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14797
+ def resource(resource_id:, org_id: nil, request_options: nil)
14798
+ @transport.request(
14799
+ http_method: "GET",
14800
+ path: "/api/org/{orgId}/ownership/resource",
14801
+ path_params: { "orgId" => org_id },
14802
+ query: { "resourceId" => resource_id },
14803
+ request_options: request_options
14804
+ )
14805
+ end
14806
+
14807
+ # Set a resource's ownership
14808
+ #
14809
+ # Upsert keyed by `resourceId`: ownership is a property of the resource, so
14810
+ # there is no separate create and update. Omitted fields keep their value
14811
+ # and `null` clears one. Clearing every field removes the record entirely
14812
+ # and the response is `null`, which is the new truth rather than an empty
14813
+ # record. An `ownerUserId` must be a member of this organization: ownership
14814
+ # that looks routable but reaches nobody is worse than none.
14815
+ #
14816
+ # _Requires permission: `resources:write`._
14817
+ #
14818
+ # PUT /api/org/{orgId}/ownership
14819
+ #
14820
+ # Raises on 400: Bad request
14821
+ #
14822
+ # Raises on 404: Not found
14823
+ #
14824
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14825
+ # constructed with.
14826
+ # @param body [Hash, nil] Request body, shaped as `ResourceOwnershipPatch`.
14827
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14828
+ # @return [Hash] Parsed JSON, shaped as `ResourceOwnership & Hash | nil` — see
14829
+ # `sig/infrawrench/sdk.rbs`.
14830
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14831
+ def update(org_id: nil, body: nil, request_options: nil)
14832
+ @transport.request(
14833
+ http_method: "PUT",
14834
+ path: "/api/org/{orgId}/ownership",
14835
+ path_params: { "orgId" => org_id },
14836
+ body: body,
14837
+ request_options: request_options
14838
+ )
14839
+ end
14840
+ end
14841
+
14842
+ # `client.pages`
14843
+ class PagesNamespace
14844
+ # @api private
14845
+ # @param transport [Transport]
14846
+ def initialize(transport)
14847
+ @transport = transport
14848
+ end
14849
+
14850
+ # Raise an alert to the organization's on-call transports
14851
+ #
14852
+ # Fans an alert out over whatever the org has configured (Twilio SMS (and
14853
+ # voice on request), mobile push, Slack channels, and Microsoft Teams
14854
+ # webhooks) honouring each recipient's opt-ins. This is the same alert a
14855
+ # workflow raises with `infra.page(...)`, for code that runs somewhere
14856
+ # Infrawrench does not: a health check, a deploy script, a cron on a box.
14857
+ #
14858
+ # Repeat pages under the same `(source, key)` are **suppressed, not
14859
+ # rejected**: a monitor that fires every minute pages once and then gets
14860
+ # `200` with `suppressed: true` and the `retryAt` at which the key can page
14861
+ # again. A page that reached nobody does not start a cooldown, so the next
14862
+ # call tries again.
14863
+ #
14864
+ # Recipients opt in per channel under the same setting that covers workflow
14865
+ # pages.
14866
+ #
14867
+ # _Requires permission: `pages:write`._
14868
+ #
14869
+ # POST /api/org/{orgId}/pages
14870
+ #
14871
+ # Raises on 400: Bad request
14872
+ #
14873
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14874
+ # constructed with.
14875
+ # @param body [Hash] Request body, shaped as `PageRequest`.
14876
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14877
+ # @return [Hash] Parsed JSON, shaped as `PageResponse` — see `sig/infrawrench/sdk.rbs`.
14878
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14879
+ def create(body:, org_id: nil, request_options: nil)
14880
+ @transport.request(
14881
+ http_method: "POST",
14882
+ path: "/api/org/{orgId}/pages",
14883
+ path_params: { "orgId" => org_id },
14884
+ body: body,
14885
+ request_options: request_options
14886
+ )
14887
+ end
14888
+
14889
+ # Clear a page key's cooldown
14890
+ #
14891
+ # Drops the cooldown for one `(source, key)` so the next page under it
14892
+ # delivers immediately. Call it when the condition you alerted on recovers;
14893
+ # the workflow equivalent is `infra.page.clear(key)`. Clearing a key that
14894
+ # was never paged is not an error.
14895
+ #
14896
+ # _Requires permission: `pages:write`._
14897
+ #
14898
+ # DELETE /api/org/{orgId}/pages
14899
+ #
14900
+ # Raises on 400: Bad request
14901
+ #
14902
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14903
+ # constructed with.
14904
+ # @param source [String] Stable name for the system raising the page: letters, digits, `.`,
14905
+ # `_` and `-`. It is the notification's sender, and it scopes the cooldown; two services
14906
+ # paging under the same key never throttle each other.
14907
+ # @param key [String, nil] Defaults to `default`.
14908
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14909
+ # @return [Hash] Parsed JSON, shaped as `PageClearResponse` — see `sig/infrawrench/sdk.rbs`.
14910
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14911
+ def delete(source:, org_id: nil, key: nil, request_options: nil)
14912
+ @transport.request(
14913
+ http_method: "DELETE",
14914
+ path: "/api/org/{orgId}/pages",
14915
+ path_params: { "orgId" => org_id },
14916
+ query: { "source" => source, "key" => key },
14917
+ request_options: request_options
14918
+ )
14919
+ end
14920
+ end
14921
+
14922
+ # `client.paging_incidents`
14923
+ class PagingIncidentsNamespace
14924
+ # @api private
14925
+ # @param transport [Transport]
14926
+ def initialize(transport)
14927
+ @transport = transport
14928
+ end
14929
+
14930
+ # Acknowledge a provider incident
14931
+ #
14932
+ # Written to the provider as the acting member where the provider records
14933
+ # who acted (PagerDuty's `From` header), falling back to the account's
14934
+ # default user. The returned state is the provider's answer, not an
14935
+ # assumption.
14936
+ #
14937
+ # POST /api/org/{orgId}/paging-incidents/{id}/acknowledge
14938
+ #
14939
+ # Raises on 400: Bad request
14940
+ #
14941
+ # Raises on 401: Unauthenticated
14942
+ #
14943
+ # Raises on 402: Payment required: the organization's plan does not include
14944
+ # this
14945
+ #
14946
+ # Raises on 403: Forbidden
14947
+ #
14948
+ # Raises on 404: Not found
14949
+ #
14950
+ # Raises on 409: Conflict
14951
+ #
14952
+ # Raises on 500: Server error
14953
+ #
14954
+ # Raises on 503: A backing service this endpoint depends on is not available
14955
+ #
14956
+ # Raises on reauth: Recent sign-in required. Send the user through sign-in
14957
+ # again and retry; the request itself was well-formed.
14958
+ #
14959
+ # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
14960
+ # @param id [String]
14961
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14962
+ # @return [Hash] Parsed JSON, shaped as `PagerIncident` — see `sig/infrawrench/sdk.rbs`.
14963
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
14964
+ def acknowledge(id:, org_id: nil, request_options: nil)
14965
+ @transport.request(
14966
+ http_method: "POST",
14967
+ path: "/api/org/{orgId}/paging-incidents/{id}/acknowledge",
14968
+ path_params: { "orgId" => org_id, "id" => id },
14969
+ request_options: request_options
14970
+ )
14971
+ end
14972
+
14973
+ # List incidents mirrored from paging providers
14974
+ #
14975
+ # Only accounts with inbound mirroring turned on contribute. Open incidents
14976
+ # by default; `status=all` includes resolved ones. These are a provider's
14977
+ # pages, distinct from incidents declared in Infrawrench (`/incidents`).
14978
+ #
14979
+ # GET /api/org/{orgId}/paging-incidents
14980
+ #
14981
+ # Raises on 400: Bad request
14982
+ #
14983
+ # Raises on 401: Unauthenticated
14984
+ #
14985
+ # Raises on 402: Payment required: the organization's plan does not include
14986
+ # this
14987
+ #
14988
+ # Raises on 403: Forbidden
14989
+ #
14990
+ # Raises on 404: Not found
14991
+ #
14992
+ # Raises on 409: Conflict
14993
+ #
14994
+ # Raises on 500: Server error
14995
+ #
14996
+ # Raises on 503: A backing service this endpoint depends on is not available
14997
+ #
14998
+ # Raises on reauth: Recent sign-in required. Send the user through sign-in
14999
+ # again and retry; the request itself was well-formed.
15000
+ #
15001
+ # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
15002
+ # constructed with.
15003
+ # @param status [String, nil]
15004
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15005
+ # @return [Hash] Parsed JSON, shaped as `PagerIncidentsResponse` — see
15006
+ # `sig/infrawrench/sdk.rbs`.
15007
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
15008
+ def get(org_id: nil, status: nil, request_options: nil)
15009
+ @transport.request(
15010
+ http_method: "GET",
15011
+ path: "/api/org/{orgId}/paging-incidents",
15012
+ path_params: { "orgId" => org_id },
15013
+ query: { "status" => status },
15014
+ request_options: request_options
15015
+ )
15016
+ end
15017
+
15018
+ # Resolve a provider incident
15019
+ #
15020
+ # Written to the provider as the acting member where the provider records
15021
+ # who acted (PagerDuty's `From` header), falling back to the account's
15022
+ # default user. The returned state is the provider's answer, not an
15023
+ # assumption.
15024
+ #
15025
+ # POST /api/org/{orgId}/paging-incidents/{id}/resolve
15026
+ #
15027
+ # Raises on 400: Bad request
15028
+ #
15029
+ # Raises on 401: Unauthenticated
15030
+ #
15031
+ # Raises on 402: Payment required: the organization's plan does not include
15032
+ # this
15033
+ #
15034
+ # Raises on 403: Forbidden
15035
+ #
15036
+ # Raises on 404: Not found
15037
+ #
15038
+ # Raises on 409: Conflict
15039
+ #
15040
+ # Raises on 500: Server error
15041
+ #
15042
+ # Raises on 503: A backing service this endpoint depends on is not available
15043
+ #
15044
+ # Raises on reauth: Recent sign-in required. Send the user through sign-in
15045
+ # again and retry; the request itself was well-formed.
15046
+ #
15047
+ # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
15048
+ # @param id [String]
15049
+ # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
15050
+ # @return [Hash] Parsed JSON, shaped as `PagerIncident` — see `sig/infrawrench/sdk.rbs`.
15051
+ # @raise [Infrawrench::ApiError] On any non-2xx response.
15052
+ def resolve(id:, org_id: nil, request_options: nil)
14134
15053
  @transport.request(
14135
- http_method: "GET",
14136
- path: "/api/org/{orgId}/orphans",
14137
- path_params: { "orgId" => org_id },
15054
+ http_method: "POST",
15055
+ path: "/api/org/{orgId}/paging-incidents/{id}/resolve",
15056
+ path_params: { "orgId" => org_id, "id" => id },
14138
15057
  request_options: request_options
14139
15058
  )
14140
15059
  end
14141
15060
  end
14142
15061
 
14143
- # `client.ownership`
14144
- class OwnershipNamespace
15062
+ # `client.paging_providers.on_call`
15063
+ class PagingProvidersOnCallNamespace
14145
15064
  # @api private
14146
15065
  # @param transport [Transport]
14147
15066
  def initialize(transport)
14148
15067
  @transport = transport
14149
15068
  end
14150
15069
 
14151
- # Clear a resource's ownership
14152
- #
14153
- # Removes the ownership record. The resource itself is untouched.
15070
+ # Who is on call on a provider schedule or escalation policy
14154
15071
  #
14155
- # _Requires permission: `resources:write`._
15072
+ # Takes `team:read`, like the rotation preview. Each person is matched to an
15073
+ # organization member by email; `memberUserId` is null for somebody who is
15074
+ # on call upstream but not a member here.
14156
15075
  #
14157
- # DELETE /api/org/{orgId}/ownership
15076
+ # GET /api/org/{orgId}/paging-providers/{accountId}/on-call/{sourceId}
14158
15077
  #
14159
15078
  # Raises on 400: Bad request
14160
15079
  #
15080
+ # Raises on 401: Unauthenticated
15081
+ #
15082
+ # Raises on 402: Payment required: the organization's plan does not include
15083
+ # this
15084
+ #
15085
+ # Raises on 403: Forbidden
15086
+ #
14161
15087
  # Raises on 404: Not found
14162
15088
  #
14163
- # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14164
- # constructed with.
14165
- # @param resource_id [String]
15089
+ # Raises on 409: Conflict
15090
+ #
15091
+ # Raises on 500: Server error
15092
+ #
15093
+ # Raises on 503: A backing service this endpoint depends on is not available
15094
+ #
15095
+ # Raises on reauth: Recent sign-in required. Send the user through sign-in
15096
+ # again and retry; the request itself was well-formed.
15097
+ #
15098
+ # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
15099
+ # @param account_id [String] A connected account whose plugin can page
15100
+ # @param source_id [String]
14166
15101
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14167
- # @return [nil] This endpoint returns no content.
15102
+ # @return [Hash] Parsed JSON, shaped as `PagingOnCallNowResponse` — see
15103
+ # `sig/infrawrench/sdk.rbs`.
14168
15104
  # @raise [Infrawrench::ApiError] On any non-2xx response.
14169
- def delete(resource_id:, org_id: nil, request_options: nil)
15105
+ def get(account_id:, source_id:, org_id: nil, request_options: nil)
14170
15106
  @transport.request(
14171
- http_method: "DELETE",
14172
- path: "/api/org/{orgId}/ownership",
14173
- path_params: { "orgId" => org_id },
14174
- query: { "resourceId" => resource_id },
14175
- accept: :empty,
15107
+ http_method: "GET",
15108
+ path: "/api/org/{orgId}/paging-providers/{accountId}/on-call/{sourceId}",
15109
+ path_params: { "orgId" => org_id, "accountId" => account_id, "sourceId" => source_id },
14176
15110
  request_options: request_options
14177
15111
  )
14178
15112
  end
15113
+ end
14179
15114
 
14180
- # List resource ownership records
15115
+ # `client.paging_providers`
15116
+ class PagingProvidersNamespace
15117
+ # @return [PagingProvidersOnCallNamespace] `client.paging_providers.on_call`
15118
+ attr_reader :on_call
15119
+
15120
+ # @api private
15121
+ # @param transport [Transport]
15122
+ def initialize(transport)
15123
+ @transport = transport
15124
+ @on_call = PagingProvidersOnCallNamespace.new(@transport)
15125
+ end
15126
+
15127
+ # List the targets and on-call sources a routing rule can name
14181
15128
  #
14182
- # Every ownership record in the organization; owner, purpose and authorizing
14183
- # ticket, per resource. Only resources somebody has recorded something about
14184
- # appear; an absent record means the resource is unowned.
15129
+ # Listed live from each provider, so a destination is picked by name. A
15130
+ # failure is reported per account in `error` rather than failing the
15131
+ # response.
14185
15132
  #
14186
- # _Requires permission: `resources:read`._
15133
+ # GET /api/org/{orgId}/paging-providers/destinations
14187
15134
  #
14188
- # GET /api/org/{orgId}/ownership
15135
+ # Raises on 400: Bad request
15136
+ #
15137
+ # Raises on 401: Unauthenticated
15138
+ #
15139
+ # Raises on 402: Payment required: the organization's plan does not include
15140
+ # this
15141
+ #
15142
+ # Raises on 403: Forbidden
15143
+ #
15144
+ # Raises on 404: Not found
15145
+ #
15146
+ # Raises on 409: Conflict
15147
+ #
15148
+ # Raises on 500: Server error
15149
+ #
15150
+ # Raises on 503: A backing service this endpoint depends on is not available
15151
+ #
15152
+ # Raises on reauth: Recent sign-in required. Send the user through sign-in
15153
+ # again and retry; the request itself was well-formed.
14189
15154
  #
14190
15155
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14191
15156
  # constructed with.
14192
15157
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14193
- # @return [Hash] Parsed JSON, shaped as `ResourceOwnershipListResponse` — see
15158
+ # @return [Hash] Parsed JSON, shaped as `PagingDestinationsResponse` — see
14194
15159
  # `sig/infrawrench/sdk.rbs`.
14195
15160
  # @raise [Infrawrench::ApiError] On any non-2xx response.
14196
- def get(org_id: nil, request_options: nil)
15161
+ def destinations(org_id: nil, request_options: nil)
14197
15162
  @transport.request(
14198
15163
  http_method: "GET",
14199
- path: "/api/org/{orgId}/ownership",
15164
+ path: "/api/org/{orgId}/paging-providers/destinations",
14200
15165
  path_params: { "orgId" => org_id },
14201
15166
  request_options: request_options
14202
15167
  )
14203
15168
  end
14204
15169
 
14205
- # List people an owner can be set to
15170
+ # List upstream alerts Infrawrench opened
14206
15171
  #
14207
- # Org members, as a minimal id/name/email projection for the owner picker.
14208
- # Requires only `resources:read`, deliberately not `team:read`: recording
14209
- # who owns a resource must not be reserved for whoever can also read roles
14210
- # and membership.
15172
+ # One row per (account, target, dedup key): a trigger, its acknowledgement
15173
+ # and its resolution are one alert upstream. `pendingAction` is set while a
15174
+ # send is queued or being retried.
14211
15175
  #
14212
- # _Requires permission: `resources:read`._
15176
+ # GET /api/org/{orgId}/paging-providers/events
14213
15177
  #
14214
- # GET /api/org/{orgId}/ownership/members
15178
+ # Raises on 400: Bad request
15179
+ #
15180
+ # Raises on 401: Unauthenticated
15181
+ #
15182
+ # Raises on 402: Payment required: the organization's plan does not include
15183
+ # this
15184
+ #
15185
+ # Raises on 403: Forbidden
15186
+ #
15187
+ # Raises on 404: Not found
15188
+ #
15189
+ # Raises on 409: Conflict
15190
+ #
15191
+ # Raises on 500: Server error
15192
+ #
15193
+ # Raises on 503: A backing service this endpoint depends on is not available
15194
+ #
15195
+ # Raises on reauth: Recent sign-in required. Send the user through sign-in
15196
+ # again and retry; the request itself was well-formed.
14215
15197
  #
14216
15198
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14217
15199
  # constructed with.
15200
+ # @param limit [Integer, nil]
14218
15201
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14219
- # @return [Hash] Parsed JSON, shaped as `OwnerCandidateListResponse` — see
15202
+ # @return [Hash] Parsed JSON, shaped as `PagingEventsResponse` — see
14220
15203
  # `sig/infrawrench/sdk.rbs`.
14221
15204
  # @raise [Infrawrench::ApiError] On any non-2xx response.
14222
- def members(org_id: nil, request_options: nil)
15205
+ def events(org_id: nil, limit: nil, request_options: nil)
14223
15206
  @transport.request(
14224
15207
  http_method: "GET",
14225
- path: "/api/org/{orgId}/ownership/members",
15208
+ path: "/api/org/{orgId}/paging-providers/events",
14226
15209
  path_params: { "orgId" => org_id },
15210
+ query: { "limit" => limit },
14227
15211
  request_options: request_options
14228
15212
  )
14229
15213
  end
14230
15214
 
14231
- # Get one resource's ownership
15215
+ # List paging provider accounts and their settings
14232
15216
  #
14233
- # The ownership record for a single resource, or null when none is recorded.
15217
+ # GET /api/org/{orgId}/paging-providers
14234
15218
  #
14235
- # _Requires permission: `resources:read`._
15219
+ # Raises on 400: Bad request
14236
15220
  #
14237
- # GET /api/org/{orgId}/ownership/resource
15221
+ # Raises on 401: Unauthenticated
14238
15222
  #
14239
- # Raises on 400: Bad request
15223
+ # Raises on 402: Payment required: the organization's plan does not include
15224
+ # this
15225
+ #
15226
+ # Raises on 403: Forbidden
15227
+ #
15228
+ # Raises on 404: Not found
15229
+ #
15230
+ # Raises on 409: Conflict
15231
+ #
15232
+ # Raises on 500: Server error
15233
+ #
15234
+ # Raises on 503: A backing service this endpoint depends on is not available
15235
+ #
15236
+ # Raises on reauth: Recent sign-in required. Send the user through sign-in
15237
+ # again and retry; the request itself was well-formed.
14240
15238
  #
14241
15239
  # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14242
15240
  # constructed with.
14243
- # @param resource_id [String]
14244
15241
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14245
- # @return [Hash] Parsed JSON, shaped as `ResourceOwnershipEnvelope` — see
15242
+ # @return [Hash] Parsed JSON, shaped as `PagingProvidersResponse` — see
14246
15243
  # `sig/infrawrench/sdk.rbs`.
14247
15244
  # @raise [Infrawrench::ApiError] On any non-2xx response.
14248
- def resource(resource_id:, org_id: nil, request_options: nil)
15245
+ def get(org_id: nil, request_options: nil)
14249
15246
  @transport.request(
14250
15247
  http_method: "GET",
14251
- path: "/api/org/{orgId}/ownership/resource",
15248
+ path: "/api/org/{orgId}/paging-providers",
14252
15249
  path_params: { "orgId" => org_id },
14253
- query: { "resourceId" => resource_id },
14254
15250
  request_options: request_options
14255
15251
  )
14256
15252
  end
14257
15253
 
14258
- # Set a resource's ownership
14259
- #
14260
- # Upsert keyed by `resourceId`: ownership is a property of the resource, so
14261
- # there is no separate create and update. Omitted fields keep their value
14262
- # and `null` clears one. Clearing every field removes the record entirely
14263
- # and the response is `null`, which is the new truth rather than an empty
14264
- # record. An `ownerUserId` must be a member of this organization: ownership
14265
- # that looks routable but reaches nobody is worse than none.
15254
+ # Configure incident mirroring for a paging provider account
14266
15255
  #
14267
- # _Requires permission: `resources:write`._
15256
+ # Turning inbound on with a `managed` webhook subscribes one through the
15257
+ # provider's API; turning it off removes the subscription and forgets the
15258
+ # mirrored incidents. A webhook that cannot be subscribed is reported in
15259
+ # `warning` and mirroring falls back to reconciling on a timer.
14268
15260
  #
14269
- # PUT /api/org/{orgId}/ownership
15261
+ # PUT /api/org/{orgId}/paging-providers/{accountId}/settings
14270
15262
  #
14271
15263
  # Raises on 400: Bad request
14272
15264
  #
15265
+ # Raises on 401: Unauthenticated
15266
+ #
15267
+ # Raises on 402: Payment required: the organization's plan does not include
15268
+ # this
15269
+ #
15270
+ # Raises on 403: Forbidden
15271
+ #
14273
15272
  # Raises on 404: Not found
14274
15273
  #
14275
- # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14276
- # constructed with.
14277
- # @param body [Hash, nil] Request body, shaped as `ResourceOwnershipPatch`.
15274
+ # Raises on 409: Conflict
15275
+ #
15276
+ # Raises on 500: Server error
15277
+ #
15278
+ # Raises on 503: A backing service this endpoint depends on is not available
15279
+ #
15280
+ # Raises on reauth: Recent sign-in required. Send the user through sign-in
15281
+ # again and retry; the request itself was well-formed.
15282
+ #
15283
+ # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
15284
+ # @param account_id [String] A connected account whose plugin can page
15285
+ # @param body [Hash, nil] Request body, shaped as `PagingProviderSettingsInput`.
14278
15286
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14279
- # @return [Hash] Parsed JSON, shaped as `ResourceOwnership & Hash | nil` — see
15287
+ # @return [Hash] Parsed JSON, shaped as `PagingProviderSettingsResult` — see
14280
15288
  # `sig/infrawrench/sdk.rbs`.
14281
15289
  # @raise [Infrawrench::ApiError] On any non-2xx response.
14282
- def update(org_id: nil, body: nil, request_options: nil)
15290
+ def settings(account_id:, org_id: nil, body: nil, request_options: nil)
14283
15291
  @transport.request(
14284
15292
  http_method: "PUT",
14285
- path: "/api/org/{orgId}/ownership",
14286
- path_params: { "orgId" => org_id },
15293
+ path: "/api/org/{orgId}/paging-providers/{accountId}/settings",
15294
+ path_params: { "orgId" => org_id, "accountId" => account_id },
14287
15295
  body: body,
14288
15296
  request_options: request_options
14289
15297
  )
14290
15298
  end
14291
- end
14292
-
14293
- # `client.pages`
14294
- class PagesNamespace
14295
- # @api private
14296
- # @param transport [Transport]
14297
- def initialize(transport)
14298
- @transport = transport
14299
- end
14300
15299
 
14301
- # Raise an alert to the organization's on-call transports
15300
+ # Reconcile an account's incidents now
14302
15301
  #
14303
- # Fans an alert out over whatever the org has configured (Twilio SMS (and
14304
- # voice on request), mobile push, Slack channels, and Microsoft Teams
14305
- # webhooks) honouring each recipient's opt-ins. This is the same alert a
14306
- # workflow raises with `infra.page(...)`, for code that runs somewhere
14307
- # Infrawrench does not: a health check, a deploy script, a cron on a box.
15302
+ # POST /api/org/{orgId}/paging-providers/{accountId}/sync
14308
15303
  #
14309
- # Repeat pages under the same `(source, key)` are **suppressed, not
14310
- # rejected**: a monitor that fires every minute pages once and then gets
14311
- # `200` with `suppressed: true` and the `retryAt` at which the key can page
14312
- # again. A page that reached nobody does not start a cooldown, so the next
14313
- # call tries again.
15304
+ # Raises on 400: Bad request
14314
15305
  #
14315
- # Recipients opt in per channel under the same setting that covers workflow
14316
- # pages.
15306
+ # Raises on 401: Unauthenticated
14317
15307
  #
14318
- # _Requires permission: `pages:write`._
15308
+ # Raises on 402: Payment required: the organization's plan does not include
15309
+ # this
14319
15310
  #
14320
- # POST /api/org/{orgId}/pages
15311
+ # Raises on 403: Forbidden
14321
15312
  #
14322
- # Raises on 400: Bad request
15313
+ # Raises on 404: Not found
14323
15314
  #
14324
- # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14325
- # constructed with.
14326
- # @param body [Hash] Request body, shaped as `PageRequest`.
15315
+ # Raises on 409: Conflict
15316
+ #
15317
+ # Raises on 500: Server error
15318
+ #
15319
+ # Raises on 503: A backing service this endpoint depends on is not available
15320
+ #
15321
+ # Raises on reauth: Recent sign-in required. Send the user through sign-in
15322
+ # again and retry; the request itself was well-formed.
15323
+ #
15324
+ # @param org_id [String, nil] Defaults to the `org_id` the client was constructed with.
15325
+ # @param account_id [String] A connected account whose plugin can page
14327
15326
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14328
- # @return [Hash] Parsed JSON, shaped as `PageResponse` — see `sig/infrawrench/sdk.rbs`.
15327
+ # @return [Hash] Parsed JSON, shaped as `PagingSyncResult` — see `sig/infrawrench/sdk.rbs`.
14329
15328
  # @raise [Infrawrench::ApiError] On any non-2xx response.
14330
- def create(body:, org_id: nil, request_options: nil)
15329
+ def sync(account_id:, org_id: nil, request_options: nil)
14331
15330
  @transport.request(
14332
15331
  http_method: "POST",
14333
- path: "/api/org/{orgId}/pages",
14334
- path_params: { "orgId" => org_id },
14335
- body: body,
15332
+ path: "/api/org/{orgId}/paging-providers/{accountId}/sync",
15333
+ path_params: { "orgId" => org_id, "accountId" => account_id },
14336
15334
  request_options: request_options
14337
15335
  )
14338
15336
  end
15337
+ end
14339
15338
 
14340
- # Clear a page key's cooldown
15339
+ # `client.paging_webhooks`
15340
+ class PagingWebhooksNamespace
15341
+ # @api private
15342
+ # @param transport [Transport]
15343
+ def initialize(transport)
15344
+ @transport = transport
15345
+ end
15346
+
15347
+ # Inbound paging provider webhook
14341
15348
  #
14342
- # Drops the cooldown for one `(source, key)` so the next page under it
14343
- # delivers immediately. Call it when the condition you alerted on recovers;
14344
- # the workflow equivalent is `infra.page.clear(key)`. Clearing a key that
14345
- # was never paged is not an error.
15349
+ # Called by the provider, not by clients. The token in the path picks the
15350
+ # account; the provider's signature, verified with the stored secret,
15351
+ # authenticates the delivery. The payload is treated as a nudge: each
15352
+ # incident it names is re-read from the provider's API.
14346
15353
  #
14347
- # _Requires permission: `pages:write`._
15354
+ # POST /api/paging-webhooks/{token}
14348
15355
  #
14349
- # DELETE /api/org/{orgId}/pages
15356
+ # Raises on 401: The signature did not verify
14350
15357
  #
14351
- # Raises on 400: Bad request
15358
+ # Raises on 404: Unknown token
14352
15359
  #
14353
- # @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
14354
- # constructed with.
14355
- # @param source [String] Stable name for the system raising the page: letters, digits, `.`,
14356
- # `_` and `-`. It is the notification's sender, and it scopes the cooldown; two services
14357
- # paging under the same key never throttle each other.
14358
- # @param key [String, nil] Defaults to `default`.
15360
+ # @param token [String]
14359
15361
  # @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
14360
- # @return [Hash] Parsed JSON, shaped as `PageClearResponse` — see `sig/infrawrench/sdk.rbs`.
15362
+ # @return [nil] This endpoint returns no content.
14361
15363
  # @raise [Infrawrench::ApiError] On any non-2xx response.
14362
- def delete(source:, org_id: nil, key: nil, request_options: nil)
15364
+ def create(token:, request_options: nil)
14363
15365
  @transport.request(
14364
- http_method: "DELETE",
14365
- path: "/api/org/{orgId}/pages",
14366
- path_params: { "orgId" => org_id },
14367
- query: { "source" => source, "key" => key },
15366
+ http_method: "POST",
15367
+ path: "/api/paging-webhooks/{token}",
15368
+ path_params: { "token" => token },
15369
+ accept: :empty,
14368
15370
  request_options: request_options
14369
15371
  )
14370
15372
  end
@@ -20939,6 +21941,8 @@ module Infrawrench
20939
21941
  attr_reader :invoices
20940
21942
  # @return [JiraNamespace] `client.jira`
20941
21943
  attr_reader :jira
21944
+ # @return [JitAccessNamespace] `client.jit_access`
21945
+ attr_reader :jit_access
20942
21946
  # @return [KvNamespace] `client.kv`
20943
21947
  attr_reader :kv
20944
21948
  # @return [LeasesNamespace] `client.leases`
@@ -20967,6 +21971,12 @@ module Infrawrench
20967
21971
  attr_reader :ownership
20968
21972
  # @return [PagesNamespace] `client.pages`
20969
21973
  attr_reader :pages
21974
+ # @return [PagingIncidentsNamespace] `client.paging_incidents`
21975
+ attr_reader :paging_incidents
21976
+ # @return [PagingProvidersNamespace] `client.paging_providers`
21977
+ attr_reader :paging_providers
21978
+ # @return [PagingWebhooksNamespace] `client.paging_webhooks`
21979
+ attr_reader :paging_webhooks
20970
21980
  # @return [PostureNamespace] `client.posture`
20971
21981
  attr_reader :posture
20972
21982
  # @return [PriceCatalogNamespace] `client.price_catalog`
@@ -21104,6 +22114,7 @@ module Infrawrench
21104
22114
  @invitations = InvitationsNamespace.new(@transport)
21105
22115
  @invoices = InvoicesNamespace.new(@transport)
21106
22116
  @jira = JiraNamespace.new(@transport)
22117
+ @jit_access = JitAccessNamespace.new(@transport)
21107
22118
  @kv = KvNamespace.new(@transport)
21108
22119
  @leases = LeasesNamespace.new(@transport)
21109
22120
  @linear = LinearNamespace.new(@transport)
@@ -21118,6 +22129,9 @@ module Infrawrench
21118
22129
  @orphans = OrphansNamespace.new(@transport)
21119
22130
  @ownership = OwnershipNamespace.new(@transport)
21120
22131
  @pages = PagesNamespace.new(@transport)
22132
+ @paging_incidents = PagingIncidentsNamespace.new(@transport)
22133
+ @paging_providers = PagingProvidersNamespace.new(@transport)
22134
+ @paging_webhooks = PagingWebhooksNamespace.new(@transport)
21121
22135
  @posture = PostureNamespace.new(@transport)
21122
22136
  @price_catalog = PriceCatalogNamespace.new(@transport)
21123
22137
  @probes = ProbesNamespace.new(@transport)