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

# Rotations

## Overview

### Available Operations

* [Create](#create) - Create Rotation
* [GetByID](#getbyid) - Get Schedule Rotation by ID
* [Update](#update) - Update Rotation
* [GetParticipants](#getparticipants) - Get Rotation Participants
* [UpdateParticipants](#updateparticipants) - Update Rotation Participants

## Create

Create Rotation

### 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.Rotations.Create(ctx, "<id>", components.V4CreateRotationRequest{
        Name: "<value>",
        StartDate: "<value>",
        Period: "<value>",
        ChangeParticipantsFrequency: 62013,
        ChangeParticipantsUnit: "<value>",
        ParticipantGroups: []components.V4ParticipantGroup{},
    })
    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. |
| `scheduleID`              | `string`                                                                                                                                         | :heavy\_check\_mark: | N/A                                 |
| `v4CreateRotationRequest` | [components.V4CreateRotationRequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/components/v4createrotationrequest.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.RotationsCreateRotationResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/rotationscreaterotationresponse.md)**, error**

### Errors

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

## GetByID

Get Schedule Rotation by ID

### 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.Rotations.GetByID(ctx, "<id>", "<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. |
| `scheduleID` | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `rotationID` | `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.RotationsGetScheduleRotationByIDResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/rotationsgetschedulerotationbyidresponse.md)**, error**

### Errors

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

## Update

Update Rotation

### 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.Rotations.Update(ctx, "<id>", "<id>", components.V4UpdateRotationRequest{
        Name: "<value>",
        StartDate: "<value>",
        Period: "<value>",
        ChangeParticipantsFrequency: 183098,
        ChangeParticipantsUnit: "<value>",
    })
    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. |
| `scheduleID`              | `string`                                                                                                                                         | :heavy\_check\_mark: | N/A                                 |
| `rotationID`              | `string`                                                                                                                                         | :heavy\_check\_mark: | N/A                                 |
| `v4UpdateRotationRequest` | [components.V4UpdateRotationRequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/components/v4updaterotationrequest.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.RotationsUpdateRotationResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/rotationsupdaterotationresponse.md)**, error**

### Errors

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

## GetParticipants

Get Rotation Participants

### 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.Rotations.GetParticipants(ctx, "<id>", "<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. |
| `scheduleID` | `string`                                                                                                          | :heavy\_check\_mark: | N/A                                 |
| `rotationID` | `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.RotationsGetRotationParticipantsResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/rotationsgetrotationparticipantsresponse.md)**, error**

### Errors

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

## UpdateParticipants

Update Rotation Participants

### 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.Rotations.UpdateParticipants(ctx, "<id>", "<id>", components.V4UpdateRotationParticipantsRequest{
        ParticipantGroups: []components.V4ParticipantGroup{},
    })
    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. |
| `scheduleID`                          | `string`                                                                                                                                                                 | :heavy\_check\_mark: | N/A                                 |
| `rotationID`                          | `string`                                                                                                                                                                 | :heavy\_check\_mark: | N/A                                 |
| `v4UpdateRotationParticipantsRequest` | [components.V4UpdateRotationParticipantsRequest](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/components/v4updaterotationparticipantsrequest.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.RotationsUpdateRotationParticipantsResponse**](https://developers.incidents.cloud.solarwinds.com/go-sdk/docs/models/operations/rotationsupdaterotationparticipantsresponse.md)**, error**

### Errors

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