Class: Infrawrench::DigestNamespace

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

Overview

client.digest

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ DigestNamespace

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

Parameters:



2930
2931
2932
2933
# File 'lib/infrawrench/client.rb', line 2930

def initialize(transport)
  @transport = transport
  @recipients = DigestRecipientsNamespace.new(@transport)
end

Instance Attribute Details

#recipientsDigestRecipientsNamespace (readonly)

Returns client.digest.recipients.

Returns:



2926
2927
2928
# File 'lib/infrawrench/client.rb', line 2926

def recipients
  @recipients
end

Instance Method Details

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

Get the organization's weekly digest settings

The weekly digest is a summary of the last complete Monday-to-Sunday week's spend (with week-over-week movers), sync incidents, and resource churn, delivered to the Slack channels and Teams webhooks opted into the weeklyDigest trigger and to the organization's digest email recipients. The response also carries the outcome of the most recent delivery attempt so a silently failing digest is visible.

GET /api/org/orgId/digest

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 DigestSettings — see sig/infrawrench/sdk.rbs.

Raises:



2951
2952
2953
2954
2955
2956
2957
2958
# File 'lib/infrawrench/client.rb', line 2951

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

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

Compose and send last week's digest now

Ignores the schedule and the enabled flag — composes the digest for the last complete week and sends it to every opted-in channel and email recipient. This is also the manual recovery for a partial delivery, which is never retried automatically. Fails when nothing is routed to receive the digest, or when every destination rejected it.

POST /api/org/orgId/digest/send

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.

  • 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 DigestSendResult — see sig/infrawrench/sdk.rbs.

Raises:



2977
2978
2979
2980
2981
2982
2983
2984
# File 'lib/infrawrench/client.rb', line 2977

def post_org_org_id_digest_send(org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/digest/send",
    path_params: { "orgId" => org_id },
    request_options: request_options
  )
end

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

Update the weekly digest settings

Every field is optional. Enabling schedules the first digest for the next configured send time rather than sending immediately — use POST /digest/send for an immediate one. The week boundary follows timezone, so the reported window is always the organization's own local Monday-to-Sunday week. Changing the schedule clears any parked failure state but never replays a week that already went out.

PUT /api/org/orgId/digest

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

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

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

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

Returns:

  • (Hash)

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

Raises:



3005
3006
3007
3008
3009
3010
3011
3012
3013
# File 'lib/infrawrench/client.rb', line 3005

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