Class: Infrawrench::CalendarNamespace

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

Overview

client.calendar

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ CalendarNamespace

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

Parameters:



2940
2941
2942
2943
# File 'lib/infrawrench/client.rb', line 2940

def initialize(transport)
  @transport = transport
  @subscriptions = CalendarSubscriptionsNamespace.new(@transport)
end

Instance Attribute Details

#subscriptionsCalendarSubscriptionsNamespace (readonly)

Returns client.calendar.subscriptions.

Returns:



2936
2937
2938
# File 'lib/infrawrench/client.rb', line 2936

def subscriptions
  @subscriptions
end

Instance Method Details

#get(org_id: nil, from: nil, to: nil, kinds: nil, request_options: nil) ⇒ Hash

List dated operational events in a window

One time axis over six things the organization already stores: change freezes, sleep/wake schedules, declared deadlines (certificates, domains, keys and resource leases), commitment term ends, cron-triggered workflow runs, and declared incidents. Nothing here is a new record — the calendar is recomputed on every read, exactly as posture findings and backup coverage are.

The window defaults to the last 7 and next 35 days and may span at most 400. Recurring sources are expanded to at most 400 occurrences each, so one nightly schedule cannot flood a year-long query.

GET /api/org/orgId/calendar

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.

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

    Inclusive lower bound. Defaults to 7 days ago.

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

    Exclusive upper bound. Defaults to 35 days ahead.

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

    Comma-separated CalendarEventKinds. Unknown members are ignored rather than rejected; omitting the parameter returns every kind.

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

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

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

Returns:

  • (Hash)

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

Raises:



2971
2972
2973
2974
2975
2976
2977
2978
2979
# File 'lib/infrawrench/client.rb', line 2971

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