Class: Infrawrench::PostureSettingsNamespace

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

Overview

client.posture.settings

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ PostureSettingsNamespace

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 PostureSettingsNamespace.

Parameters:



10229
10230
10231
# File 'lib/infrawrench/client.rb', line 10229

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Get the organization's posture alert settings

Whether the poller's daily posture alert scan is enabled. An organization that never saved reads the shipped defaults (enabled).

Requires permission: org:settings:write.

GET /api/org/orgId/posture/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 PostureAlertSettings — see sig/infrawrench/sdk.rbs.

Raises:



10248
10249
10250
10251
10252
10253
10254
10255
# File 'lib/infrawrench/client.rb', line 10248

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

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

Update the posture alert settings

Saving never resets the alert cooldown.

Requires permission: org:settings:write.

PUT /api/org/orgId/posture/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 PostureAlertSettingsUpdate.

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

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

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

Returns:

  • (Hash)

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

Raises:



10274
10275
10276
10277
10278
10279
10280
10281
10282
# File 'lib/infrawrench/client.rb', line 10274

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