Class: Infrawrench::ExpiringSettingsNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.expiring.settings

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ ExpiringSettingsNamespace

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ExpiringSettingsNamespace.

Parameters:



3477
3478
3479
# File 'lib/infrawrench/client.rb', line 3477

def initialize(transport)
  @transport = transport
end

Instance Method Details

#get(org_id: nil, request_options: nil) ⇒ Hash

Get the organization's expiry alert settings

The lead time feeds both the feed's upcoming bucket and the poller's daily alert scan. An organization that never saved reads the shipped defaults (enabled, 60 days).

Requires permission: org:settings:write.

GET /api/org/orgId/expiring/settings

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as ExpiryAlertSettings — see sig/infrawrench/sdk.rbs.

Raises:



3497
3498
3499
3500
3501
3502
3503
3504
# File 'lib/infrawrench/client.rb', line 3497

def get(org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/expiring/settings",
    path_params: { "orgId" => org_id },
    request_options: request_options
  )
end

#update(org_id: nil, body: nil, request_options: nil) ⇒ Hash

Update the expiry alert settings

Every field is optional so a single toggle can be saved on its own. leadDays must be a whole number from 1 to 365. Saving never resets the alert cooldown.

Requires permission: org:settings:write.

PUT /api/org/orgId/expiring/settings

Raises on 400: Bad request

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • body (Hash, nil) (defaults to: nil)

    Request body, shaped as ExpiryAlertSettingsUpdate.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • body: (expiry_alert_settings_update, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as ExpiryAlertSettings — see sig/infrawrench/sdk.rbs.

Raises:



3525
3526
3527
3528
3529
3530
3531
3532
3533
# File 'lib/infrawrench/client.rb', line 3525

def update(org_id: nil, body: nil, request_options: nil)
  @transport.request(
    http_method: "PUT",
    path: "/api/org/{orgId}/expiring/settings",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end