# DownloadQueue (*DownloadQueue*) ## Overview API Operations against the Download Queue ### Available Operations * [CreateDownloadQueue](#createdownloadqueue) - Create download queue * [GetDownloadQueue](#getdownloadqueue) - Get a download queue * [AddDownloadQueueItems](#adddownloadqueueitems) - Add to download queue * [ListDownloadQueueItems](#listdownloadqueueitems) - Get download queue items * [GetItemDecision](#getitemdecision) - Grab download queue item decision * [GetDownloadQueueMedia](#getdownloadqueuemedia) - Grab download queue media * [RemoveDownloadQueueItems](#removedownloadqueueitems) - Delete download queue items * [GetDownloadQueueItems](#getdownloadqueueitems) - Get download queue items * [RestartProcessingDownloadQueueItems](#restartprocessingdownloadqueueitems) - Restart processing of items from the decision ## CreateDownloadQueue Available: 0.2.0 Creates a download queue for this client if one doesn't exist, or returns the existing queue for this client and user. ### Example Usage ```go package main import( "context" "github.com/LukeHagar/plexgo" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithSecurity(""), ) res, err := s.DownloadQueue.CreateDownloadQueue(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](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response **[*operations.CreateDownloadQueueResponse](../../models/operations/createdownloadqueueresponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## GetDownloadQueue Available: 0.2.0 Get a download queue by its id ### Example Usage ```go package main import( "context" "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithAccepts(components.AcceptsApplicationXML), plexgo.WithClientIdentifier("abc123"), plexgo.WithProduct("Plex for Roku"), plexgo.WithVersion("2.4.1"), plexgo.WithPlatform("Roku"), plexgo.WithPlatformVersion("4.3 build 1057"), plexgo.WithDevice("Roku 3"), plexgo.WithModel("4200X"), plexgo.WithDeviceVendor("Roku"), plexgo.WithDeviceName("Living Room TV"), plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) res, err := s.DownloadQueue.GetDownloadQueue(ctx, operations.GetDownloadQueueRequest{ QueueID: 922802, }) 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` | [operations.GetDownloadQueueRequest](../../models/operations/getdownloadqueuerequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response **[*operations.GetDownloadQueueResponse](../../models/operations/getdownloadqueueresponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## AddDownloadQueueItems Available: 0.2.0 Add items to the download queue ### Example Usage ```go package main import( "context" "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithAccepts(components.AcceptsApplicationXML), plexgo.WithClientIdentifier("abc123"), plexgo.WithProduct("Plex for Roku"), plexgo.WithVersion("2.4.1"), plexgo.WithPlatform("Roku"), plexgo.WithPlatformVersion("4.3 build 1057"), plexgo.WithDevice("Roku 3"), plexgo.WithModel("4200X"), plexgo.WithDeviceVendor("Roku"), plexgo.WithDeviceName("Living Room TV"), plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) res, err := s.DownloadQueue.AddDownloadQueueItems(ctx, operations.AddDownloadQueueItemsRequest{ QueueID: 984925, Keys: []string{ "/library/metadata/3", "/library/metadata/6", }, AdvancedSubtitles: components.AdvancedSubtitlesBurn.ToPointer(), AudioBoost: plexgo.Pointer[int64](50), AudioChannelCount: plexgo.Pointer[int64](5), AutoAdjustQuality: components.BoolIntTrue.ToPointer(), AutoAdjustSubtitle: components.BoolIntTrue.ToPointer(), DirectPlay: components.BoolIntTrue.ToPointer(), DirectStream: components.BoolIntTrue.ToPointer(), DirectStreamAudio: components.BoolIntTrue.ToPointer(), DisableResolutionRotation: components.BoolIntTrue.ToPointer(), HasMDE: components.BoolIntTrue.ToPointer(), Location: components.LocationWan.ToPointer(), MediaBufferSize: plexgo.Pointer[int64](102400), MediaIndex: plexgo.Pointer[int64](0), MusicBitrate: plexgo.Pointer[int64](5000), Offset: plexgo.Pointer[float64](90.5), PartIndex: plexgo.Pointer[int64](0), Path: plexgo.Pointer("/library/metadata/151671"), PeakBitrate: plexgo.Pointer[int64](12000), PhotoResolution: plexgo.Pointer("1080x1080"), Protocol: components.ProtocolDash.ToPointer(), SecondsPerSegment: plexgo.Pointer[int64](5), SubtitleSize: plexgo.Pointer[int64](50), VideoBitrate: plexgo.Pointer[int64](12000), VideoQuality: plexgo.Pointer[int64](50), VideoResolution: plexgo.Pointer("1080x1080"), }) 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` | [operations.AddDownloadQueueItemsRequest](../../models/operations/adddownloadqueueitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response **[*operations.AddDownloadQueueItemsResponse](../../models/operations/adddownloadqueueitemsresponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## ListDownloadQueueItems Available: 0.2.0 Get items from a download queue ### Example Usage ```go package main import( "context" "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithAccepts(components.AcceptsApplicationXML), plexgo.WithClientIdentifier("abc123"), plexgo.WithProduct("Plex for Roku"), plexgo.WithVersion("2.4.1"), plexgo.WithPlatform("Roku"), plexgo.WithPlatformVersion("4.3 build 1057"), plexgo.WithDevice("Roku 3"), plexgo.WithModel("4200X"), plexgo.WithDeviceVendor("Roku"), plexgo.WithDeviceName("Living Room TV"), plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) res, err := s.DownloadQueue.ListDownloadQueueItems(ctx, operations.ListDownloadQueueItemsRequest{ QueueID: 524138, }) 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` | [operations.ListDownloadQueueItemsRequest](../../models/operations/listdownloadqueueitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response **[*operations.ListDownloadQueueItemsResponse](../../models/operations/listdownloadqueueitemsresponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## GetItemDecision Available: 0.2.0 Grab the decision for a download queue item ### Example Usage ```go package main import( "context" "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithAccepts(components.AcceptsApplicationXML), plexgo.WithClientIdentifier("abc123"), plexgo.WithProduct("Plex for Roku"), plexgo.WithVersion("2.4.1"), plexgo.WithPlatform("Roku"), plexgo.WithPlatformVersion("4.3 build 1057"), plexgo.WithDevice("Roku 3"), plexgo.WithModel("4200X"), plexgo.WithDeviceVendor("Roku"), plexgo.WithDeviceName("Living Room TV"), plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) res, err := s.DownloadQueue.GetItemDecision(ctx, operations.GetItemDecisionRequest{ QueueID: 231605, ItemID: 32, }) if err != nil { log.Fatal(err) } if res.MediaContainerWithDecision != 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` | [operations.GetItemDecisionRequest](../../models/operations/getitemdecisionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response **[*operations.GetItemDecisionResponse](../../models/operations/getitemdecisionresponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## GetDownloadQueueMedia Available: 0.2.0 Grab the media for a download queue item ### Example Usage ```go package main import( "context" "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithAccepts(components.AcceptsApplicationXML), plexgo.WithClientIdentifier("abc123"), plexgo.WithProduct("Plex for Roku"), plexgo.WithVersion("2.4.1"), plexgo.WithPlatform("Roku"), plexgo.WithPlatformVersion("4.3 build 1057"), plexgo.WithDevice("Roku 3"), plexgo.WithModel("4200X"), plexgo.WithDeviceVendor("Roku"), plexgo.WithDeviceName("Living Room TV"), plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) res, err := s.DownloadQueue.GetDownloadQueueMedia(ctx, operations.GetDownloadQueueMediaRequest{ QueueID: 663184, ItemID: 32, }) if err != nil { log.Fatal(err) } if res != 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` | [operations.GetDownloadQueueMediaRequest](../../models/operations/getdownloadqueuemediarequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response **[*operations.GetDownloadQueueMediaResponse](../../models/operations/getdownloadqueuemediaresponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## RemoveDownloadQueueItems delete items from a download queue ### Example Usage ```go package main import( "context" "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithAccepts(components.AcceptsApplicationXML), plexgo.WithClientIdentifier("abc123"), plexgo.WithProduct("Plex for Roku"), plexgo.WithVersion("2.4.1"), plexgo.WithPlatform("Roku"), plexgo.WithPlatformVersion("4.3 build 1057"), plexgo.WithDevice("Roku 3"), plexgo.WithModel("4200X"), plexgo.WithDeviceVendor("Roku"), plexgo.WithDeviceName("Living Room TV"), plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) res, err := s.DownloadQueue.RemoveDownloadQueueItems(ctx, operations.RemoveDownloadQueueItemsRequest{ QueueID: 946275, ItemID: []int64{ 32, 345, 23, }, }) if err != nil { log.Fatal(err) } if res != 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` | [operations.RemoveDownloadQueueItemsRequest](../../models/operations/removedownloadqueueitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response **[*operations.RemoveDownloadQueueItemsResponse](../../models/operations/removedownloadqueueitemsresponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## GetDownloadQueueItems Available: 0.2.0 Get items from a download queue ### Example Usage ```go package main import( "context" "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithAccepts(components.AcceptsApplicationXML), plexgo.WithClientIdentifier("abc123"), plexgo.WithProduct("Plex for Roku"), plexgo.WithVersion("2.4.1"), plexgo.WithPlatform("Roku"), plexgo.WithPlatformVersion("4.3 build 1057"), plexgo.WithDevice("Roku 3"), plexgo.WithModel("4200X"), plexgo.WithDeviceVendor("Roku"), plexgo.WithDeviceName("Living Room TV"), plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) res, err := s.DownloadQueue.GetDownloadQueueItems(ctx, operations.GetDownloadQueueItemsRequest{ QueueID: 809886, ItemID: []int64{ 32, 345, 23, }, }) 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` | [operations.GetDownloadQueueItemsRequest](../../models/operations/getdownloadqueueitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response **[*operations.GetDownloadQueueItemsResponse](../../models/operations/getdownloadqueueitemsresponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## RestartProcessingDownloadQueueItems Available: 0.2.0 Reprocess download queue items with previous decision parameters ### Example Usage ```go package main import( "context" "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithAccepts(components.AcceptsApplicationXML), plexgo.WithClientIdentifier("abc123"), plexgo.WithProduct("Plex for Roku"), plexgo.WithVersion("2.4.1"), plexgo.WithPlatform("Roku"), plexgo.WithPlatformVersion("4.3 build 1057"), plexgo.WithDevice("Roku 3"), plexgo.WithModel("4200X"), plexgo.WithDeviceVendor("Roku"), plexgo.WithDeviceName("Living Room TV"), plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) res, err := s.DownloadQueue.RestartProcessingDownloadQueueItems(ctx, operations.RestartProcessingDownloadQueueItemsRequest{ QueueID: 713001, ItemID: []int64{ 32, 345, 23, }, }) if err != nil { log.Fatal(err) } if res != 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` | [operations.RestartProcessingDownloadQueueItemsRequest](../../models/operations/restartprocessingdownloadqueueitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response **[*operations.RestartProcessingDownloadQueueItemsResponse](../../models/operations/restartprocessingdownloadqueueitemsresponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* |