Class: Infrawrench::DigestRecipientsNamespace

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

Overview

client.digest.recipients

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ DigestRecipientsNamespace

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

Parameters:



2847
2848
2849
# File 'lib/infrawrench/client.rb', line 2847

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Add a digest email recipient

Adding an address the organization already has is a no-op that returns the existing entry, so a double submit cannot double-deliver.

POST /api/org/orgId/digest/recipients

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

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

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

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

Returns:

  • (Hash)

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

Raises:



2867
2868
2869
2870
2871
2872
2873
2874
2875
# File 'lib/infrawrench/client.rb', line 2867

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

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

Remove a digest email recipient

DELETE /api/org/orgId/digest/recipients/recipientId

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.

  • recipient_id (String)

    Recipient id

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

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

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

Returns:

  • (Hash)

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

Raises:



2889
2890
2891
2892
2893
2894
2895
2896
# File 'lib/infrawrench/client.rb', line 2889

def delete(recipient_id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/digest/recipients/{recipientId}",
    path_params: { "orgId" => org_id, "recipientId" => recipient_id },
    request_options: request_options
  )
end

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

List the organization's digest email recipients

Email is a digest-only transport, so its destinations are an organization-level address list rather than a per-channel trigger. Addresses need not belong to Infrawrench users — a finance alias is a valid recipient.

GET /api/org/orgId/digest/recipients

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

Raises:



2913
2914
2915
2916
2917
2918
2919
2920
# File 'lib/infrawrench/client.rb', line 2913

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