# 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](/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsGetAllTeamsResponse**](/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](/go-sdk/docs/models/components/v3teamscreateteamrequest.md) | :heavy\_check\_mark: | The request object to use for the request. |
| `opts`    | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                  | :heavy\_minus\_sign: | The options for this request.              |

### Response

[**\*operations.TeamsCreateTeamResponse**](/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](/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsGetTeamByIDResponse**](/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](/go-sdk/docs/models/components/v3teamsupdateteamrequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                     | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                  | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsUpdateTeamResponse**](/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](/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsRemoveTeamResponse**](/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](/go-sdk/docs/models/components/v3teamsaddteammemberrequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                        | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                        | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsAddTeamMemberResponse**](/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](/go-sdk/docs/models/components/v3teamsaddbulkteammemberrequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                            | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                                | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsAddBulkTeamMemberResponse**](/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](/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsRemoveTeamMemberResponse**](/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](/go-sdk/docs/models/components/v3teamsupdateteammemberrequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                           | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                              | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsUpdateTeamMemberResponse**](/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](/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsGetAllTeamRolesResponse**](/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](/go-sdk/docs/models/components/v3teamscreateteamrolerequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                         | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                          | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsCreateTeamRoleResponse**](/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](/go-sdk/docs/models/operations/option.md) | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsRemoveTeamRoleResponse**](/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](/go-sdk/docs/models/components/v3teamsupdateteamrolerequest.md) | :heavy\_check\_mark: | N/A                                 |
| `opts`                         | \[][operations.Option](/go-sdk/docs/models/operations/option.md)                                          | :heavy\_minus\_sign: | The options for this request.       |

### Response

[**\*operations.TeamsUpdateTeamRoleResponse**](/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    | \*/\*            |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/sdks/teams.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
