> For the complete documentation index, see [llms.txt](https://developers.incidents.cloud.solarwinds.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/sdks/teams.md).

# Teams

## Overview

### Available Operations

* [GetAll](#getall) - Get All Teams
* [Create](#create) - Create Team
* [GetByID](#getbyid) - Get Team By ID
* [Update](#update) - Update Team
* [Delete](#delete) - Remove Team
* [AddMember](#addmember) - Add Team Member
* [AddBulkMember](#addbulkmember) - Add Bulk Team Member
* [RemoveMember](#removemember) - Remove Team Member
* [UpdateMember](#updatemember) - Update Team Member
* [GetAllRoles](#getallroles) - Get All Team Roles
* [CreateRole](#createrole) - Create Team Role
* [RemoveRole](#removerole) - Remove Team Role
* [UpdateRole](#updaterole) - Update Team Role

## GetAll

Returns all the teams of the organization. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `read` scope.

### Example Usage

```go
package main

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

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

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

    res, err := s.Teams.GetAll(ctx)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

### Parameters

| Parameter | Type                                                                                                              | Required             | Description                         |
| --------- | ----------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`     | [context.Context](https://pkg.go.dev/context#Context)                                                             | :heavy\_check\_mark: | The context to use for the request. |
| `opts`    | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsGetAllTeamsResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/teamsgetallteamsresponse.md)**, 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    | \*/\*            |

## Create

Add team to the organization. Returns the team object in response. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```go
package main

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

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

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

    res, err := s.Teams.Create(ctx, components.V3TeamsCreateTeamRequest{
        Name: "<value>",
        MemberIds: []string{
            "<value 1>",
            "<value 2>",
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

### Parameters

| Parameter | Type                                                                                                                                               | Required             | Description                                |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------ |
| `ctx`     | [context.Context](https://pkg.go.dev/context#Context)                                                                                              | :heavy\_check\_mark: | The context to use for the request.        |
| `request` | [components.V3TeamsCreateTeamRequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/components/v3teamscreateteamrequest.md) | :heavy\_check\_mark: | The request object to use for the request. |
| `opts`    | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md)                                  | :heavy\_minus\_sign: | The options for this request.              |

### Response

[**\*operations.TeamsCreateTeamResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/teamscreateteamresponse.md)**, 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    | \*/\*            |

## GetByID

Returns a team details of the given `teamID` in the request param. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `read` scope.

### Example Usage

```go
package main

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

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

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

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

### Parameters

| Parameter | Type                                                                                                              | Required             | Description                         |
| --------- | ----------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`     | [context.Context](https://pkg.go.dev/context#Context)                                                             | :heavy\_check\_mark: | The context to use for the request. |
| `teamID`  | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `opts`    | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsGetTeamByIDResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/teamsgetteambyidresponse.md)**, 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    | \*/\*            |

## Update

Update organization team details. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```go
package main

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

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

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

    res, err := s.Teams.Update(ctx, "<id>", components.V3TeamsUpdateTeamRequest{
        Members: []components.V3TeamsUpdateTeamRequestMember{},
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

### Parameters

| Parameter                  | Type                                                                                                                                               | Required             | Description                         |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`                      | [context.Context](https://pkg.go.dev/context#Context)                                                                                              | :heavy\_check\_mark: | The context to use for the request. |
| `teamID`                   | `string`                                                                                                                                           | :heavy\_check\_mark: | N/A                                 |
| `v3TeamsUpdateTeamRequest` | [components.V3TeamsUpdateTeamRequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/components/v3teamsupdateteamrequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                     | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md)                                  | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsUpdateTeamResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/teamsupdateteamresponse.md)**, 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

Remove team from the organization. Upon success, the team will be removed from the organization. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```go
package main

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

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

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

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

### Parameters

| Parameter | Type                                                                                                              | Required             | Description                         |
| --------- | ----------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`     | [context.Context](https://pkg.go.dev/context#Context)                                                             | :heavy\_check\_mark: | The context to use for the request. |
| `teamID`  | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `opts`    | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsRemoveTeamResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/teamsremoveteamresponse.md)**, 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    | \*/\*            |

## AddMember

Add team member to the team. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```go
package main

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

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

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

    res, err := s.Teams.AddMember(ctx, "<id>", components.V3TeamsAddTeamMemberRequest{
        UserID: "<id>",
        RoleIds: []string{},
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

### Parameters

| Parameter                     | Type                                                                                                                                                     | Required             | Description                         |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`                         | [context.Context](https://pkg.go.dev/context#Context)                                                                                                    | :heavy\_check\_mark: | The context to use for the request. |
| `teamID`                      | `string`                                                                                                                                                 | :heavy\_check\_mark: | N/A                                 |
| `v3TeamsAddTeamMemberRequest` | [components.V3TeamsAddTeamMemberRequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/components/v3teamsaddteammemberrequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                        | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md)                                        | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsAddTeamMemberResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/teamsaddteammemberresponse.md)**, 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    | \*/\*            |

## AddBulkMember

Add team member to the team. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```go
package main

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

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

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

    res, err := s.Teams.AddBulkMember(ctx, "<id>", components.V3TeamsAddBulkTeamMemberRequest{
        Members: []components.V3TeamsAddBulkTeamMemberRequestMember{
            components.V3TeamsAddBulkTeamMemberRequestMember{
                UserID: "<id>",
                RoleIds: []string{
                    "<value 1>",
                    "<value 2>",
                },
            },
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

### Parameters

| Parameter                         | Type                                                                                                                                                             | Required             | Description                         |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`                             | [context.Context](https://pkg.go.dev/context#Context)                                                                                                            | :heavy\_check\_mark: | The context to use for the request. |
| `teamID`                          | `string`                                                                                                                                                         | :heavy\_check\_mark: | N/A                                 |
| `v3TeamsAddBulkTeamMemberRequest` | [components.V3TeamsAddBulkTeamMemberRequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/components/v3teamsaddbulkteammemberrequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                            | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md)                                                | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsAddBulkTeamMemberResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/teamsaddbulkteammemberresponse.md)**, 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    | \*/\*            |

## RemoveMember

Remove team member from the team. Upon success, the team member will be removed from the team. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```go
package main

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

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

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

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

### Parameters

| Parameter  | Type                                                                                                              | Required             | Description                         |
| ---------- | ----------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`      | [context.Context](https://pkg.go.dev/context#Context)                                                             | :heavy\_check\_mark: | The context to use for the request. |
| `teamID`   | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `memberID` | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `opts`     | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsRemoveTeamMemberResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/teamsremoveteammemberresponse.md)**, 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    | \*/\*            |

## UpdateMember

Update team member. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```go
package main

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

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

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

    res, err := s.Teams.UpdateMember(ctx, "<id>", "<id>", components.V3TeamsUpdateTeamMemberRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

### Parameters

| Parameter                        | Type                                                                                                                                                           | Required             | Description                         |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`                            | [context.Context](https://pkg.go.dev/context#Context)                                                                                                          | :heavy\_check\_mark: | The context to use for the request. |
| `teamID`                         | `string`                                                                                                                                                       | :heavy\_check\_mark: | N/A                                 |
| `memberID`                       | `string`                                                                                                                                                       | :heavy\_check\_mark: | N/A                                 |
| `v3TeamsUpdateTeamMemberRequest` | [components.V3TeamsUpdateTeamMemberRequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/components/v3teamsupdateteammemberrequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                           | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md)                                              | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsUpdateTeamMemberResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/teamsupdateteammemberresponse.md)**, 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    | \*/\*            |

## GetAllRoles

Returns all the roles of the teamId mentioned in params. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `read` scope.

### Example Usage

```go
package main

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

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

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

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

### Parameters

| Parameter | Type                                                                                                              | Required             | Description                         |
| --------- | ----------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`     | [context.Context](https://pkg.go.dev/context#Context)                                                             | :heavy\_check\_mark: | The context to use for the request. |
| `teamID`  | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `opts`    | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsGetAllTeamRolesResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/teamsgetallteamrolesresponse.md)**, 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    | \*/\*            |

## CreateRole

Add team's role to the team with given ability if not exists. Returns the role object in response. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```go
package main

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

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

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

    res, err := s.Teams.CreateRole(ctx, "<id>", components.V3TeamsCreateTeamRoleRequest{
        Name: "<value>",
        Abilities: components.V3TeamsAbilities{},
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

### Parameters

| Parameter                      | Type                                                                                                                                                       | Required             | Description                         |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`                          | [context.Context](https://pkg.go.dev/context#Context)                                                                                                      | :heavy\_check\_mark: | The context to use for the request. |
| `teamID`                       | `string`                                                                                                                                                   | :heavy\_check\_mark: | N/A                                 |
| `v3TeamsCreateTeamRoleRequest` | [components.V3TeamsCreateTeamRoleRequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/components/v3teamscreateteamrolerequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                         | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md)                                          | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsCreateTeamRoleResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/teamscreateteamroleresponse.md)**, 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    | \*/\*            |

## RemoveRole

Remove team's role from the team. Upon success, the team's role will be removed from the team. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```go
package main

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

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

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

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

### Parameters

| Parameter | Type                                                                                                              | Required             | Description                         |
| --------- | ----------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`     | [context.Context](https://pkg.go.dev/context#Context)                                                             | :heavy\_check\_mark: | The context to use for the request. |
| `teamID`  | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `roleID`  | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `opts`    | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsRemoveTeamRoleResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/teamsremoveteamroleresponse.md)**, 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    | \*/\*            |

## UpdateRole

Update team's role abilities and name. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```go
package main

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

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

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

    res, err := s.Teams.UpdateRole(ctx, "<id>", "<id>", components.V3TeamsUpdateTeamRoleRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
```

### Parameters

| Parameter                      | Type                                                                                                                                                       | Required             | Description                         |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`                          | [context.Context](https://pkg.go.dev/context#Context)                                                                                                      | :heavy\_check\_mark: | The context to use for the request. |
| `teamID`                       | `string`                                                                                                                                                   | :heavy\_check\_mark: | N/A                                 |
| `roleID`                       | `string`                                                                                                                                                   | :heavy\_check\_mark: | N/A                                 |
| `v3TeamsUpdateTeamRoleRequest` | [components.V3TeamsUpdateTeamRoleRequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/components/v3teamsupdateteamrolerequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                         | \[][operations.Option](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/option.md)                                          | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsUpdateTeamRoleResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/teamsupdateteamroleresponse.md)**, 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    | \*/\*            |
