Class: Infrawrench::CalendarSubscriptionsNamespace

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

Overview

client.calendar.subscriptions

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ CalendarSubscriptionsNamespace

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

Parameters:



2850
2851
2852
# File 'lib/infrawrench/client.rb', line 2850

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Mint an iCalendar subscription URL

Returns the only copy of the feed URL. The token in it is 32 random bytes, stored as a SHA-256 hash, and is the sole credential on a route that runs outside every auth layer — treat the URL as a secret. The URL deliberately contains no organization id.

An organization may hold 25 live subscriptions; revoking makes room.

POST /api/org/orgId/calendar/subscriptions

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

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

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

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

Returns:

  • (Hash)

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

Raises:



2874
2875
2876
2877
2878
2879
2880
2881
2882
# File 'lib/infrawrench/client.rb', line 2874

def create(org_id: nil, body: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/calendar/subscriptions",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end

#delete(subscription_id:, org_id: nil, request_options: nil) ⇒ Hash

Revoke an iCalendar subscription

The URL stops working immediately. The row is kept, and revoking twice is not an error.

DELETE /api/org/orgId/calendar/subscriptions/subscriptionId

Raises on 404: Not found

Parameters:

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

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

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

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

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

Returns:

  • (Hash)

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

Raises:



2900
2901
2902
2903
2904
2905
2906
2907
# File 'lib/infrawrench/client.rb', line 2900

def delete(subscription_id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/calendar/subscriptions/{subscriptionId}",
    path_params: { "orgId" => org_id, "subscriptionId" => subscription_id },
    request_options: request_options
  )
end

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

List the organization's iCalendar subscriptions

Feed URLs that have been minted, including revoked ones — a revoked row is kept so the audit trail still resolves. The token itself is never returned.

GET /api/org/orgId/calendar/subscriptions

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

Raises:



2923
2924
2925
2926
2927
2928
2929
2930
# File 'lib/infrawrench/client.rb', line 2923

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