> 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/rotations.md).

# Rotations

## Overview

### Available Operations

* [list\_by\_schedule](#list_by_schedule) - List Schedule Rotations
* [create](#create) - Create Rotation
* [delete](#delete) - Delete Rotation
* [get\_by\_id](#get_by_id) - Get Schedule Rotation by ID
* [update](#update) - Update Rotation
* [get\_participants](#get_participants) - Get Rotation Participants
* [update\_participants](#update_participants) - Update Rotation Participants

## list\_by\_schedule

List Schedule Rotations

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.rotations.list_by_schedule(schedule_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter     | Type                                                                                                                           | Required             | Description                                                         |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `schedule_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.RotationsGetScheduleRotationsResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/rotationsgetschedulerotationsresponse.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |

## create

Create Rotation

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.rotations.create(schedule_id="<id>", name="<value>", start_date="<value>", period="<value>", change_participants_frequency=62013, change_participants_unit="<value>", participant_groups=[])

    # Handle response
    print(res)

```

### Parameters

| Parameter                       | Type                                                                                                                               | Required             | Description                                                         |
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `schedule_id`                   | *str*                                                                                                                              | :heavy\_check\_mark: | N/A                                                                 |
| `name`                          | *str*                                                                                                                              | :heavy\_check\_mark: | N/A                                                                 |
| `start_date`                    | *str*                                                                                                                              | :heavy\_check\_mark: | N/A                                                                 |
| `period`                        | *str*                                                                                                                              | :heavy\_check\_mark: | N/A                                                                 |
| `change_participants_frequency` | *int*                                                                                                                              | :heavy\_check\_mark: | N/A                                                                 |
| `change_participants_unit`      | *str*                                                                                                                              | :heavy\_check\_mark: | N/A                                                                 |
| `participant_groups`            | List\[[models.V4ParticipantGroup](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v4participantgroup.md)] | :heavy\_check\_mark: | N/A                                                                 |
| `color`                         | *Optional\[str]*                                                                                                                   | :heavy\_minus\_sign: | N/A                                                                 |
| `custom_period_frequency`       | *Optional\[int]*                                                                                                                   | :heavy\_minus\_sign: | N/A                                                                 |
| `custom_period_unit`            | *Optional\[str]*                                                                                                                   | :heavy\_minus\_sign: | N/A                                                                 |
| `shift_time_slots`              | List\[[models.V4ShiftTimeSlot](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v4shifttimeslot.md)]       | :heavy\_minus\_sign: | N/A                                                                 |
| `end_date`                      | *Optional\[str]*                                                                                                                   | :heavy\_minus\_sign: | N/A                                                                 |
| `ends_after_iterations`         | *Optional\[int]*                                                                                                                   | :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.RotationsCreateRotationResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/rotationscreaterotationresponse.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |

## delete

Delete Rotation

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.rotations.delete(schedule_id="<id>", rotation_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter     | Type                                                                                                                           | Required             | Description                                                         |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `schedule_id` | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `rotation_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

[**bytes**](https://github.com/solarwinds/squadcast-sdk-python/tree/main/squadcastv1/docs/models/.md/README.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |

## get\_by\_id

Get Schedule Rotation by ID

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.rotations.get_by_id(schedule_id="<id>", rotation_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter     | Type                                                                                                                           | Required             | Description                                                         |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `schedule_id` | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `rotation_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.RotationsGetScheduleRotationByIDResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/rotationsgetschedulerotationbyidresponse.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |

## update

Update Rotation

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.rotations.update(schedule_id="<id>", rotation_id="<id>", name="<value>", start_date="<value>", period="<value>", change_participants_frequency=183098, change_participants_unit="<value>")

    # Handle response
    print(res)

```

### Parameters

| Parameter                       | Type                                                                                                                           | Required             | Description                                                         |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `schedule_id`                   | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `rotation_id`                   | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `name`                          | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `start_date`                    | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `period`                        | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `change_participants_frequency` | *int*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `change_participants_unit`      | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `color`                         | *Optional\[str]*                                                                                                               | :heavy\_minus\_sign: | N/A                                                                 |
| `custom_period_frequency`       | *Optional\[int]*                                                                                                               | :heavy\_minus\_sign: | N/A                                                                 |
| `custom_period_unit`            | *Optional\[str]*                                                                                                               | :heavy\_minus\_sign: | N/A                                                                 |
| `shift_time_slots`              | List\[[models.V4ShiftTimeSlot](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v4shifttimeslot.md)]   | :heavy\_minus\_sign: | N/A                                                                 |
| `end_date`                      | *Optional\[str]*                                                                                                               | :heavy\_minus\_sign: | N/A                                                                 |
| `ends_after_iterations`         | *Optional\[int]*                                                                                                               | :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.RotationsUpdateRotationResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/rotationsupdaterotationresponse.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |

## get\_participants

Get Rotation Participants

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.rotations.get_participants(schedule_id="<id>", rotation_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter     | Type                                                                                                                           | Required             | Description                                                         |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------- |
| `schedule_id` | *str*                                                                                                                          | :heavy\_check\_mark: | N/A                                                                 |
| `rotation_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.RotationsGetRotationParticipantsResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/rotationsgetrotationparticipantsresponse.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |

## update\_participants

Update Rotation Participants

### Example Usage

```python
from squadcast import SquadcastSDK


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

    res = squadcast_sdk.rotations.update_participants(schedule_id="<id>", rotation_id="<id>", participant_groups=[])

    # Handle response
    print(res)

```

### Parameters

| Parameter            | Type                                                                                                                               | Required             | Description                                                         |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `schedule_id`        | *str*                                                                                                                              | :heavy\_check\_mark: | N/A                                                                 |
| `rotation_id`        | *str*                                                                                                                              | :heavy\_check\_mark: | N/A                                                                 |
| `participant_groups` | List\[[models.V4ParticipantGroup](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/v4participantgroup.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.RotationsUpdateRotationParticipantsResponse**](https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/models/rotationsupdaterotationparticipantsresponse.md)

### Errors

| Error Type             | Status Code                       | Content Type     |
| ---------------------- | --------------------------------- | ---------------- |
| errors.CommonV4Error   | 400, 401, 402, 403, 404, 409, 422 | application/json |
| errors.CommonV4Error   | 500, 502, 503, 504                | application/json |
| errors.SDKDefaultError | 4XX, 5XX                          | \*/\*            |
