Skip to content

Latest commit

 

History

History
851 lines (666 loc) · 56.5 KB

README.md

File metadata and controls

851 lines (666 loc) · 56.5 KB

Teams

(Teams)

Overview

Available Operations

ListSchedules

List all known schedules in FireHydrant as pulled from external sources

Example Usage

package main

import(
	"firehydrant"
	"context"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.ListSchedules(ctx, nil, nil, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.ScheduleEntityPaginated != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
query *string Filter schedules with a query on their name
page *int N/A
perPage *int N/A
opts []operations.Option The options for this request.

Response

*operations.ListSchedulesResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

List

List all of the teams in the organization

Example Usage

package main

import(
	"firehydrant"
	"context"
	"firehydrant/models/operations"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.List(ctx, operations.ListTeamsRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.TeamEntityPaginated != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.ListTeamsRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.ListTeamsResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

Create

Create a new team

Example Usage

package main

import(
	"firehydrant"
	"context"
	"firehydrant/models/components"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.Create(ctx, components.PostV1Teams{
        Name: "<value>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.TeamEntity != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request components.PostV1Teams ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.CreateTeamResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

Get

Retrieve a single team from its ID

Example Usage

package main

import(
	"firehydrant"
	"context"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.Get(ctx, "<id>", nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.TeamEntity != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
teamID string ✔️ N/A
lite *bool Boolean to determine whether to return a slimified version of the teams object
opts []operations.Option The options for this request.

Response

*operations.GetTeamResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

Archive

Archives an team which will hide it from lists and metrics

Example Usage

package main

import(
	"firehydrant"
	"context"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.Archive(ctx, "<id>")
    if err != nil {
        log.Fatal(err)
    }
    if res.TeamEntity != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.ArchiveTeamResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

Update

Update a single team from its ID

Example Usage

package main

import(
	"firehydrant"
	"context"
	"firehydrant/models/components"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.Update(ctx, "<id>", components.PatchV1TeamsTeamID{})
    if err != nil {
        log.Fatal(err)
    }
    if res.TeamEntity != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.UpdateTeamResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

ListOnCallSchedules

List all Signals on-call schedules for a team.

Example Usage

package main

import(
	"firehydrant"
	"context"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.ListOnCallSchedules(ctx, "<id>", nil, nil, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
teamID string ✔️ N/A
query *string A query string for searching through the list of on-call schedules.
page *int N/A
perPage *int N/A
opts []operations.Option The options for this request.

Response

*operations.ListTeamOnCallSchedulesResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

CreateOnCallSchedule

Create a Signals on-call schedule for a team.

Example Usage

package main

import(
	"firehydrant"
	"context"
	"firehydrant/models/components"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.CreateOnCallSchedule(ctx, "<id>", components.PostV1TeamsTeamIDOnCallSchedules{
        Name: "<value>",
        TimeZone: "America/Porto_Velho",
        Strategy: components.Strategy{
            Type: components.PostV1TeamsTeamIDOnCallSchedulesTypeCustom,
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.CreateTeamOnCallScheduleResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

GetScheduleShift

Get a Signals on-call shift by ID

Example Usage

package main

import(
	"firehydrant"
	"context"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.GetScheduleShift(ctx, "<id>", "<id>", "<id>")
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetTeamScheduleShiftResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

DeleteScheduleShift

Delete a Signals on-call shift by ID

Example Usage

package main

import(
	"firehydrant"
	"context"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.DeleteScheduleShift(ctx, "<id>", "<id>", "<id>")
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.DeleteTeamScheduleShiftResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

UpdateScheduleShift

Update a Signals on-call shift by ID

Example Usage

package main

import(
	"firehydrant"
	"context"
	"firehydrant/models/components"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.UpdateScheduleShift(ctx, "<id>", "<id>", "<id>", components.PatchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID{})
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
id string ✔️ N/A
teamID string ✔️ N/A
scheduleID string ✔️ N/A
patchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID components.PatchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID ✔️ N/A
opts []operations.Option The options for this request.

Response

*operations.UpdateTeamScheduleShiftResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

CreateEscalationPolicy

Create a Signals escalation policy for a team.

Example Usage

package main

import(
	"firehydrant"
	"context"
	"firehydrant/models/components"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.CreateEscalationPolicy(ctx, "<id>", components.PostV1TeamsTeamIDEscalationPolicies{
        Name: "<value>",
        Steps: []components.PostV1TeamsTeamIDEscalationPoliciesSteps{
            components.PostV1TeamsTeamIDEscalationPoliciesSteps{
                Targets: []components.Targets{
                    components.Targets{
                        Type: components.PostV1TeamsTeamIDEscalationPoliciesTypeWebhook,
                        ID: "<id>",
                    },
                    components.Targets{
                        Type: components.PostV1TeamsTeamIDEscalationPoliciesTypeEntireTeam,
                        ID: "<id>",
                    },
                    components.Targets{
                        Type: components.PostV1TeamsTeamIDEscalationPoliciesTypeEntireTeam,
                        ID: "<id>",
                    },
                },
                Timeout: "<value>",
            },
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.CreateTeamEscalationPolicyResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

UpdateEscalationPolicy

Update a Signals escalation policy by ID

Example Usage

package main

import(
	"firehydrant"
	"context"
	"firehydrant/models/components"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.UpdateEscalationPolicy(ctx, "<id>", "<id>", components.PatchV1TeamsTeamIDEscalationPoliciesID{})
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.UpdateTeamEscalationPolicyResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

CreateShift

Create a Signals on-call shift in a schedule.

Example Usage

package main

import(
	"firehydrant"
	"context"
	"firehydrant/models/components"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Teams.CreateShift(ctx, "<id>", "<id>", components.PostV1TeamsTeamIDOnCallSchedulesScheduleIDShifts{
        StartTime: "<value>",
        EndTime: "<value>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.CreateTeamOnCallScheduleShiftResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*