GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — plexgo/docs/sdks/dvrs/README.md at main · LukasParke/plexgo

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
1090 lines (862 loc) · 52 KB
/

README.md

Copy path

File metadata and controls

1090 lines (862 loc) · 52 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

DVRs

Overview

The DVR provides means to watch and record live TV. This section of endpoints describes how to setup the DVR itself

Available Operations

  • ListDVRs - Get DVRs
  • CreateDVR - Create a DVR
  • DeleteDVR - Delete a single DVR
  • GetDVR - Get a single DVR
  • PatchDVRSettings - Update DVR Settings
  • UpdateDVRSettings - Update DVR Settings
  • GetDVRChannels - Get DVR Channels
  • GetDVRGuide - Get DVR Guide
  • DeleteLineup - Delete a DVR Lineup
  • AddLineup - Add a DVR Lineup
  • SetDVRPreferences - Set DVR preferences
  • StopDVRReload - Tell a DVR to stop reloading program guide
  • ReloadGuide - Tell a DVR to reload program guide
  • TuneChannel - Tune a channel on a DVR
  • RemoveDeviceFromDVR - Remove a device from an existing DVR
  • AddDeviceToDVR - Add a device to an existing DVR

ListDVRs

Get the list of all available DVRs

Example Usage

package main

import(
	"context"
	"github.com/LukeHagar/plexgo"
	"log"
)

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

    s := plexgo.New(
        plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.ListDVRs(ctx, nil, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.DVRResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
uuid *string ➖ Filter by DVR UUID.
lineup *string ➖ Filter by lineup.
opts []operations.Option ➖ The options for this request.

Response

*operations.ListDVRsResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

CreateDVR

Creation of a DVR, after creation of a device and a lineup is selected

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.CreateDVR(ctx, operations.CreateDVRRequest{
        Lineup: plexgo.Pointer("lineup://tv.plex.providers.epg.onconnect/USA-HI51418-DEFAULT"),
        DeviceQueryParameter: []string{
            "device://tv.plex.grabbers.hdhomerun/1053C0CA",
        },
        Language: plexgo.Pointer("eng"),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.DvrRequestHandlerSlashGetResponses200 != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.CreateDVRRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.CreateDVRResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

DeleteDVR

Delete a single DVR by its id (key)

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.DeleteDVR(ctx, operations.DeleteDVRRequest{
        DvrID: 855088,
    })
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.DeleteDVRRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.DeleteDVRResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

GetDVR

Get a single DVR by its id (key)

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.GetDVR(ctx, operations.GetDVRRequest{
        DvrID: 973518,
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.DVRResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetDVRRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetDVRResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

PatchDVRSettings

Update DVR settings.

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.PatchDVRSettings(ctx, operations.PatchDVRSettingsRequest{
        DvrID: 537061,
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.SuccessResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.PatchDVRSettingsRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.PatchDVRSettingsResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

UpdateDVRSettings

Update DVR settings.

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.UpdateDVRSettings(ctx, operations.UpdateDVRSettingsRequest{
        DvrID: 614847,
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.SuccessResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.UpdateDVRSettingsRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.UpdateDVRSettingsResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

GetDVRChannels

List channels directly associated with a DVR.

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.GetDVRChannels(ctx, operations.GetDVRChannelsRequest{
        DvrID: 901521,
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithMetadata != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetDVRChannelsRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetDVRChannelsResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

GetDVRGuide

Fetch program guide/schedule for a DVR.

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.GetDVRGuide(ctx, operations.GetDVRGuideRequest{
        DvrID: 19054,
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithMetadata != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetDVRGuideRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetDVRGuideResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

DeleteLineup

Deletes a DVR device's lineup.

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.DeleteLineup(ctx, operations.DeleteLineupRequest{
        DvrID: 454470,
        Lineup: "<value>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.DVRResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.DeleteLineupRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.DeleteLineupResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

AddLineup

Add a lineup to a DVR device's set of lineups.

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.AddLineup(ctx, operations.AddLineupRequest{
        DvrID: 945235,
        Lineup: "<value>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.DVRResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.AddLineupRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.AddLineupResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

SetDVRPreferences

Set DVR preferences by name and value

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.SetDVRPreferences(ctx, operations.SetDVRPreferencesRequest{
        DvrID: 116357,
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.DVRResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.SetDVRPreferencesRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.SetDVRPreferencesResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

StopDVRReload

Tell a DVR to stop reloading program guide

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.StopDVRReload(ctx, operations.StopDVRReloadRequest{
        DvrID: 348053,
    })
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.StopDVRReloadRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.StopDVRReloadResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

ReloadGuide

Tell a DVR to reload program guide

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.ReloadGuide(ctx, operations.ReloadGuideRequest{
        DvrID: 140753,
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Body != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.ReloadGuideRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.ReloadGuideResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

TuneChannel

Tune a channel on a DVR to the provided channel

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.TuneChannel(ctx, operations.TuneChannelRequest{
        DvrID: 834281,
        Channel: "2.1",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithMetadata != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.TuneChannelRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.TuneChannelResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*

RemoveDeviceFromDVR

Remove a device from an existing DVR

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.RemoveDeviceFromDVR(ctx, operations.RemoveDeviceFromDVRRequest{
        DvrID: 945416,
        DeviceID: 260761,
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.RemoveDeviceFromDVRRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.RemoveDeviceFromDVRResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

AddDeviceToDVR

Add a device to an existing DVR

Example Usage

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("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.DVRs.AddDeviceToDVR(ctx, operations.AddDeviceToDVRRequest{
        DvrID: 334755,
        DeviceID: 852930,
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.AddDeviceToDVRRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.AddDeviceToDVRResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.