Skip to content

Latest commit

 

History

History
210 lines (162 loc) · 14.5 KB

File metadata and controls

210 lines (162 loc) · 14.5 KB

AdditionalResponders

(Incidents.AdditionalResponders)

Overview

Available Operations

  • Get - Get Additional Responders
  • Add - Add Additional Responders
  • Delete - Remove Additional Responders

Get

  • This endpoint is used to get the incident additional responders.

  • Requires access_token as a Bearer {{token}} in the Authorization header.

Example Usage

package main

import(
	"context"
	"os"
	squadcastsdk "github.com/SquadcastHub/squadcast-sdk-go"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
    )

    res, err := s.Incidents.AdditionalResponders.Get(ctx, "<id>")
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
incidentID string ✔️ N/A
opts []operations.Option The options for this request.

Response

*operations.AdditionalRespondersGetAdditionalRespondersResponse, error

Errors

Error Type Status Code Content Type
apierrors.BadRequestError 400 application/json
apierrors.UnauthorizedError 401 application/json
apierrors.PaymentRequiredError 402 application/json
apierrors.ForbiddenError 403 application/json
apierrors.NotFoundError 404 application/json
apierrors.ConflictError 409 application/json
apierrors.UnprocessableEntityError 422 application/json
apierrors.InternalServerError 500 application/json
apierrors.BadGatewayError 502 application/json
apierrors.ServiceUnavailableError 503 application/json
apierrors.GatewayTimeoutError 504 application/json
apierrors.APIError 4XX, 5XX */*

Add

  • This endpoint is used to add additional responders to an Incident.

  • Requires access_token as a Bearer {{token}} in the Authorization header.

Example Usage

package main

import(
	"context"
	"os"
	squadcastsdk "github.com/SquadcastHub/squadcast-sdk-go"
	"github.com/SquadcastHub/squadcast-sdk-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
    )

    res, err := s.Incidents.AdditionalResponders.Add(ctx, "<id>", components.V3IncidentsAdditionalRespondersAddAdditionalRespondersRequest{
        AdditionalResponders: []components.AdditionalResponder{},
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
incidentID string ✔️ N/A
v3IncidentsAdditionalRespondersAddAdditionalRespondersRequest components.V3IncidentsAdditionalRespondersAddAdditionalRespondersRequest ✔️ N/A
opts []operations.Option The options for this request.

Response

*operations.AdditionalRespondersAddAdditionalRespondersResponse, error

Errors

Error Type Status Code Content Type
apierrors.BadRequestError 400 application/json
apierrors.UnauthorizedError 401 application/json
apierrors.PaymentRequiredError 402 application/json
apierrors.ForbiddenError 403 application/json
apierrors.NotFoundError 404 application/json
apierrors.ConflictError 409 application/json
apierrors.UnprocessableEntityError 422 application/json
apierrors.InternalServerError 500 application/json
apierrors.BadGatewayError 502 application/json
apierrors.ServiceUnavailableError 503 application/json
apierrors.GatewayTimeoutError 504 application/json
apierrors.APIError 4XX, 5XX */*

Delete

  • This endpoint is used to remove an additional responder from an Incident.

  • Requires access_token as a Bearer {{token}} in the Authorization header.

Example Usage

package main

import(
	"context"
	"os"
	squadcastsdk "github.com/SquadcastHub/squadcast-sdk-go"
	"log"
)

func main() {
    ctx := context.Background()

    s := squadcastsdk.New(
        squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
    )

    res, err := s.Incidents.AdditionalResponders.Delete(ctx, "<id>", "<id>")
    if err != nil {
        log.Fatal(err)
    }
    if res.Body != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
incidentID string ✔️ N/A
responderID string ✔️ N/A
opts []operations.Option The options for this request.

Response

*operations.AdditionalRespondersRemoveAdditionalRespondersResponse, error

Errors

Error Type Status Code Content Type
apierrors.BadRequestError 400 application/json
apierrors.UnauthorizedError 401 application/json
apierrors.PaymentRequiredError 402 application/json
apierrors.ForbiddenError 403 application/json
apierrors.NotFoundError 404 application/json
apierrors.ConflictError 409 application/json
apierrors.UnprocessableEntityError 422 application/json
apierrors.InternalServerError 500 application/json
apierrors.BadGatewayError 502 application/json
apierrors.ServiceUnavailableError 503 application/json
apierrors.GatewayTimeoutError 504 application/json
apierrors.APIError 4XX, 5XX */*