# Workflows

## Overview

### Available Operations

* [List](#list) - List Workflows
* [Create](#create) - Create Workflow
* [BulkEnableDisable](#bulkenabledisable) - Bulk Enable/Disable Workflows
* [Delete](#delete) - Delete Workflow
* [GetByID](#getbyid) - Get Workflow By ID
* [Update](#update) - Update Workflow
* [UpdateActionsOrder](#updateactionsorder) - Update Actions Order
* [DeleteAction](#deleteaction) - Delete Workflow Action
* [GetAction](#getaction) - Get Workflow Action By ID
* [UpdateAction](#updateaction) - Update Workflow Action
* [ToggleEnable](#toggleenable) - Enable/Disable Workflow
* [GetLogs](#getlogs) - Get Workflow Logs

## List

Get a list of all Workflows

### Example Usage

```go
package main

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

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

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

    res, err := s.Workflows.List(ctx, operations.WorkflowsListWorkflowsRequest{
        OwnerID: "<id>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.V3WorkflowsListWorkflowAPIResponse != nil {
        for {
            // handle items

            res, err = res.Next()

            if err != nil {
                // handle error
            }

            if res == nil {
                break
            }
        }
    }
}
```

### 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` | [operations.WorkflowsListWorkflowsRequest](/go-sdk/docs/models/operations/workflowslistworkflowsrequest.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.WorkflowsListWorkflowsResponse**](/go-sdk/docs/models/operations/workflowslistworkflowsresponse.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

Create a Workflow

### 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.Workflows.Create(ctx, components.V3WorkflowsCreateWorkflowRequest{
        Title: "<value>",
        OwnerID: "<id>",
        Trigger: components.V3WorkflowsWorkflowTriggerIncidentAcknowledged,
        Filters: components.V3WorkflowsCreateWorkflowFilter{},
        Actions: []components.V3WorkflowsActionRequest{
            components.CreateV3WorkflowsActionRequestV3WorkflowsSqTriggerManualWebhook(
                components.V3WorkflowsSqTriggerManualWebhook{
                    Name: components.V3WorkflowsSqTriggerManualWebhookNameSqTriggerManualWebhook,
                    Data: components.V3WorkflowsSqTriggerManualWebhookData{
                        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.        |
| `request` | [components.V3WorkflowsCreateWorkflowRequest](/go-sdk/docs/models/components/v3workflowscreateworkflowrequest.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.WorkflowsCreateWorkflowResponse**](/go-sdk/docs/models/operations/workflowscreateworkflowresponse.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    | \*/\*            |

## BulkEnableDisable

Bulk enable or disable workflows

### 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.Workflows.BulkEnableDisable(ctx, components.V3WorkflowsBulkEnableDisableWorkflowsRequest{
        OwnerID: "<id>",
        Enabled: false,
        WorkflowIds: []int{
            124939,
        },
    })
    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.        |
| `request` | [components.V3WorkflowsBulkEnableDisableWorkflowsRequest](/go-sdk/docs/models/components/v3workflowsbulkenabledisableworkflowsrequest.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.WorkflowsBulkEnabledisableWorkflowsResponse**](/go-sdk/docs/models/operations/workflowsbulkenabledisableworkflowsresponse.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

Delete a workflow 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.Workflows.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. |
| `workflowID` | `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.WorkflowsDeleteWorkflowResponse**](/go-sdk/docs/models/operations/workflowsdeleteworkflowresponse.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

Get a workflow 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.Workflows.GetByID(ctx, "<id>")
    if err != nil {
        log.Fatal(err)
    }
    if res.V3WorkflowsGetWorkflowByIDResponse != 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. |
| `workflowID` | `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.WorkflowsGetWorkflowByIDResponse**](/go-sdk/docs/models/operations/workflowsgetworkflowbyidresponse.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 a Workflow

### 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.Workflows.Update(ctx, "<id>", components.V3WorkflowsCreateWorkflowRequestUpdate{})
    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. |
| `workflowID`                             | `string`                                                                                                                      | :heavy\_check\_mark: | N/A                                 |
| `v3WorkflowsCreateWorkflowRequestUpdate` | [components.V3WorkflowsCreateWorkflowRequestUpdate](/go-sdk/docs/models/components/v3workflowscreateworkflowrequestupdate.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.WorkflowsUpdateWorkflowResponse**](/go-sdk/docs/models/operations/workflowsupdateworkflowresponse.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    | \*/\*            |

## UpdateActionsOrder

Update action order in a workflow

### 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.Workflows.UpdateActionsOrder(ctx, "<id>", components.V3WorkflowsUpdateActionsOrderRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.V3WorkflowsUpdateActionsOrderResponse != 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. |
| `workflowID`                           | `string`                                                                                                                  | :heavy\_check\_mark: | N/A                                 |
| `v3WorkflowsUpdateActionsOrderRequest` | [components.V3WorkflowsUpdateActionsOrderRequest](/go-sdk/docs/models/components/v3workflowsupdateactionsorderrequest.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.WorkflowsUpdateActionsOrderResponse**](/go-sdk/docs/models/operations/workflowsupdateactionsorderresponse.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    | \*/\*            |

## DeleteAction

Delete an action by action 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.Workflows.DeleteAction(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. |
| `workflowID` | `string`                                                         | :heavy\_check\_mark: | N/A                                 |
| `actionID`   | `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.WorkflowsDeleteWorkflowActionResponse**](/go-sdk/docs/models/operations/workflowsdeleteworkflowactionresponse.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    | \*/\*            |

## GetAction

Get workflow action 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.Workflows.GetAction(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. |
| `workflowID` | `string`                                                         | :heavy\_check\_mark: | N/A                                 |
| `actionID`   | `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.WorkflowsGetWorkflowActionByIDResponse**](/go-sdk/docs/models/operations/workflowsgetworkflowactionbyidresponse.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    | \*/\*            |

## UpdateAction

Update an action by action ID

### Example Usage

```go
package main

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

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

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

    res, err := s.Workflows.UpdateAction(ctx, "<id>", "<id>", components.CreateV3WorkflowsActionRequestUpdateAny(
        map[string]any{
            "name": "slack_message_channel",
        },
    ))
    if err != nil {
        log.Fatal(err)
    }
    if res.OneOf != nil {
        switch res.OneOf.Type {
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeSqAttachRunbooks:
                // res.OneOf.SqAttachRunbooks is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsSqMarkIncidentSLOAffecting:
                // res.OneOf.V3WorkflowsSqMarkIncidentSLOAffecting is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsSqTriggerManualWebhook:
                // res.OneOf.V3WorkflowsSqTriggerManualWebhook is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsUpdateIncidentPriority:
                // res.OneOf.V3WorkflowsUpdateIncidentPriority is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsSqCreateStatusPageIssue:
                // res.OneOf.V3WorkflowsSqCreateStatusPageIssue is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsSqAddIncidentNote:
                // res.OneOf.V3WorkflowsSqAddIncidentNote is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsSlackArchiveChannel:
                // res.OneOf.V3WorkflowsSlackArchiveChannel is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsSqAddCommunicationChannel:
                // res.OneOf.V3WorkflowsSqAddCommunicationChannel is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsSlackMessageChannel:
                // res.OneOf.V3WorkflowsSlackMessageChannel is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsSlackMessageUser:
                // res.OneOf.V3WorkflowsSlackMessageUser is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsSqMakeHTTPCall:
                // res.OneOf.V3WorkflowsSqMakeHTTPCall is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsSlackCreateIncidentChannel:
                // res.OneOf.V3WorkflowsSlackCreateIncidentChannel is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsJiraCreateTicket:
                // res.OneOf.V3WorkflowsJiraCreateTicket is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsMsTeamsMessageChannel:
                // res.OneOf.V3WorkflowsMsTeamsMessageChannel is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsMsTeamsMessageUser:
                // res.OneOf.V3WorkflowsMsTeamsMessageUser is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsSqSendEmail:
                // res.OneOf.V3WorkflowsSqSendEmail is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeV3WorkflowsMsTeamsCreateMeetingLink:
                // res.OneOf.V3WorkflowsMsTeamsCreateMeetingLink is populated
            case operations.WorkflowsUpdateWorkflowActionResponseBodyTypeAny:
                // res.OneOf.Any is populated
        }

    }
}
```

### Parameters

| Parameter                        | Type                                                                                                          | Required             | Description                         |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------------------------- |
| `ctx`                            | [context.Context](https://pkg.go.dev/context#Context)                                                         | :heavy\_check\_mark: | The context to use for the request. |
| `workflowID`                     | `string`                                                                                                      | :heavy\_check\_mark: | N/A                                 |
| `actionID`                       | `string`                                                                                                      | :heavy\_check\_mark: | N/A                                 |
| `v3WorkflowsActionRequestUpdate` | [components.V3WorkflowsActionRequestUpdate](/go-sdk/docs/models/components/v3workflowsactionrequestupdate.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.WorkflowsUpdateWorkflowActionResponse**](/go-sdk/docs/models/operations/workflowsupdateworkflowactionresponse.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    | \*/\*            |

## ToggleEnable

Enable or disable workflow by ID

### 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.Workflows.ToggleEnable(ctx, "<id>", components.V3WorkflowsEnableDisableWorkflowRequest{})
    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. |
| `workflowID`                              | `string`                                                                                                                        | :heavy\_check\_mark: | N/A                                 |
| `v3WorkflowsEnableDisableWorkflowRequest` | [components.V3WorkflowsEnableDisableWorkflowRequest](/go-sdk/docs/models/components/v3workflowsenabledisableworkflowrequest.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.WorkflowsEnabledisableWorkflowResponse**](/go-sdk/docs/models/operations/workflowsenabledisableworkflowresponse.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    | \*/\*            |

## GetLogs

Get workflow logs

### 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.Workflows.GetLogs(ctx, "<id>", nil, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.V3WorkflowsGetWorkflowLogsResponse != nil {
        for {
            // handle items

            res, err = res.Next()

            if err != nil {
                // handle error
            }

            if res == nil {
                break
            }
        }
    }
}
```

### Parameters

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

### Response

[**\*operations.WorkflowsGetWorkflowLogsResponse**](/go-sdk/docs/models/operations/workflowsgetworkflowlogsresponse.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/workflows.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.
