> 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/python-sdk/docs/sdks/roles.md).

# Teams.Roles

## Overview

### Available Operations

* [get\_all](#get_all) - Get All Team Roles
* [create](#create) - Create Team Role
* [update](#update) - Update Team Role

## get\_all

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

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.teams.roles.get_all(team_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter | Type                                                                                                                           | Required             | Description                                                         |
| --------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `team_id` | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `retries` | [Optional\[utils.RetryConfig\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.TeamsGetAllTeamRolesResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/teamsgetallteamrolesresponse.md)

### Errors

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

## create

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

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.teams.roles.create(team_id="<id>", name="<value>", abilities={})

    # Handle response
    print(res)

```

### Parameters

| Parameter   | Type                                                                                                                           | Required             | Description                                                         |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `team_id`   | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `name`      | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `abilities` | [models.V3TeamsAbilities](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v3teamsabilities.md)        | :heavy\_check\_mark: | N/A                                                                 |
| `retries`   | [Optional\[utils.RetryConfig\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.TeamsCreateTeamRoleResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/teamscreateteamroleresponse.md)

### Errors

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

## update

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

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.teams.roles.update(team_id="<id>", role_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter   | Type                                                                                                                                | Required             | Description                                                         |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `team_id`   | *str*                                                                                                                               | :heavy\_check\_mark: | N/A                                                                 |
| `role_id`   | *str*                                                                                                                               | :heavy\_check\_mark: | N/A                                                                 |
| `name`      | *Optional\[str]*                                                                                                                    | :heavy\_minus\_sign: | N/A                                                                 |
| `abilities` | [Optional\[models.V3TeamsAbilities\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v3teamsabilities.md) | :heavy\_minus\_sign: | N/A                                                                 |
| `retries`   | [Optional\[utils.RetryConfig\]](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/utils/retryconfig.md)      | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.TeamsUpdateTeamRoleResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/teamsupdateteamroleresponse.md)

### Errors

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