Class: Infrawrench::IncidentsNotesNamespace

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

Overview

client.incidents.notes

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ IncidentsNotesNamespace

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

Parameters:



7774
7775
7776
# File 'lib/infrawrench/client.rb', line 7774

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Add an operator note

The running commentary no join can reconstruct. occurredAt may be backdated so a note typed at 04:00 lands on the timeline where it belongs.

Requires permission: incidents:write.

POST /api/org/orgId/incidents/incidentId/notes

Raises on 400: Bad request

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.

  • incident_id (String)
  • body (Hash, nil) (defaults to: nil)

    Request body, shaped as IncidentNoteCreate.

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

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

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

Returns:

  • (Hash)

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

Raises:



7798
7799
7800
7801
7802
7803
7804
7805
7806
# File 'lib/infrawrench/client.rb', line 7798

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

#delete(incident_id:, note_id:, org_id: nil, request_options: nil) ⇒ nil

Delete an operator note

Requires permission: incidents:write.

DELETE /api/org/orgId/incidents/incidentId/notes/noteId

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.

  • incident_id (String)
  • note_id (String)
  • request_options (Hash, nil) (defaults to: nil)

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

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

Returns:

  • (nil)

    This endpoint returns no content.

Raises:



7823
7824
7825
7826
7827
7828
7829
7830
7831
# File 'lib/infrawrench/client.rb', line 7823

def delete(incident_id:, note_id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/incidents/{incidentId}/notes/{noteId}",
    path_params: { "orgId" => org_id, "incidentId" => incident_id, "noteId" => note_id },
    accept: :empty,
    request_options: request_options
  )
end