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/general/README.md at main · LukasParke/plexgo

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
2358 lines (1850 loc) · 119 KB
/

README.md

Copy path

File metadata and controls

2358 lines (1850 loc) · 119 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

General

Overview

General endpoints for basic PMS operation not specific to any media provider

Available Operations

  • GetServerInfo - Get PMS info
  • GetSystemAccounts - Get System Accounts
  • GetUserWebhooks - User Webhooks
  • AddUserWebhook - Add User Webhook
  • GetClients - Get Clients
  • GetCloudServer - Get Cloud Server
  • GetSystemDevices - Get System Devices
  • GetDiagnostics - Get Diagnostics
  • DownloadDatabaseDiagnostics - Download Database Diagnostics
  • DownloadLogBundle - Download Log Bundle
  • GetGeoIP - Get GeoIP
  • GetIdentity - Get PMS identity
  • GetIP - Get IP
  • ClaimServer - Claim Server
  • RefreshReachability - Refresh Reachability
  • GetSourceConnectionInformation - Get Source Connection Information
  • CreateTransientToken - Get Transient Tokens
  • GetLocalServers - Get Local Servers
  • BrowseFilesystem - Browse Filesystem
  • GetBandwidthStatistics - Get Bandwidth Statistics
  • GetResourceStatistics - Get Resource Statistics
  • GetSyncStatus - Get Sync Status
  • GetSyncItems - Get Sync Items
  • GetSyncQueue - Get Sync Queue
  • RefreshSyncContent - Refresh Sync Content
  • RefreshSyncLists - Refresh Sync Lists
  • GetSyncTranscodeQueue - Get Sync Transcode Queue
  • GetMetadataAgents - Get Metadata Agents
  • GetSystemSettings - Get System Settings
  • CheckForSystemUpdates - Check for System Updates
  • GetWebhooks - Get Webhooks
  • AddWebhook - Add Webhook
  • GetPlexDownloads - Get Plex Downloads
  • BrowseFilesystemPath - Browse Filesystem Path
  • GetSyncItem - Get Sync Item
  • GetMetadataAgentDetails - Get Metadata Agent Details

GetServerInfo

Information about this PMS setup and configuration

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.General.GetServerInfo(ctx, operations.GetServerInfoRequest{})
    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.GetServerInfoRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetServerInfoResponse, error

Errors

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

GetSystemAccounts

Get a list of local system accounts.

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.General.GetSystemAccounts(ctx, operations.GetSystemAccountsRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDirectory != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetSystemAccountsResponse, error

Errors

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

GetUserWebhooks

List webhook URLs for the logged-in user.

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.General.GetUserWebhooks(ctx)
    if err != nil {
        log.Fatal(err)
    }
    if res.WebhookPayload != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetUserWebhooksResponse, error

Errors

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

AddUserWebhook

Add a webhook URL for the logged-in user.

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.General.AddUserWebhook(ctx, operations.AddUserWebhookRequest{})
    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.AddUserWebhookRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.AddUserWebhookResponse, error

Errors

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

GetClients

Get a list of connected Plex clients.

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.General.GetClients(ctx, operations.GetClientsRequest{})
    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.GetClientsRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetClientsResponse, error

Errors

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

GetCloudServer

Get Plex Cloud server status for the logged-in user.

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.General.GetCloudServer(ctx, operations.GetCloudServerRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.CloudServerResponse != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetCloudServerResponse, error

Errors

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

GetSystemDevices

Get a list of local system devices.

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.General.GetSystemDevices(ctx, operations.GetSystemDevicesRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDevice != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetSystemDevicesResponse, error

Errors

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

GetDiagnostics

Get server diagnostics overview.

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.General.GetDiagnostics(ctx, operations.GetDiagnosticsRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDirectory != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetDiagnosticsResponse, error

Errors

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

DownloadDatabaseDiagnostics

Download server database diagnostics bundle.

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.General.DownloadDatabaseDiagnostics(ctx, operations.DownloadDatabaseDiagnosticsRequest{})
    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.DownloadDatabaseDiagnosticsRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.DownloadDatabaseDiagnosticsResponse, error

Errors

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

DownloadLogBundle

Download server logs bundle.

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.General.DownloadLogBundle(ctx, operations.DownloadLogBundleRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.BinaryResponse != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.DownloadLogBundleResponse, error

Errors

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

GetGeoIP

Get GeoIP lookup information for the current request.

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.General.GetGeoIP(ctx, operations.GetGeoIPRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.GeoIPResponse != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetGeoIPResponse, error

Errors

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

GetIdentity

Get details about this PMS's identity

Example Usage

package main

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

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

    s := plexgo.New()

    res, err := s.General.GetIdentity(ctx)
    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.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetIdentityResponse, error

Errors

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

GetIP

Get the public IP address detected by Plex.

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.General.GetIP(ctx, operations.GetIPRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.IPResponse != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetIPResponse, error

Errors

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

ClaimServer

Claim the local PMS server using a claim token obtained from plex.tv.

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.General.ClaimServer(ctx, operations.ClaimServerRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.ClaimTokenResponse != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.ClaimServerResponse, error

Errors

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

RefreshReachability

Refresh remote access port mapping.

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.General.RefreshReachability(ctx)
    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.
opts []operations.Option ➖ The options for this request.

Response

*operations.RefreshReachabilityResponse, error

Errors

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

GetSourceConnectionInformation

If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token.

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.General.GetSourceConnectionInformation(ctx, operations.GetSourceConnectionInformationRequest{
        Source: "server://client-identifier",
        Refresh: components.BoolIntTrue.ToPointer(),
    })
    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.GetSourceConnectionInformationRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetSourceConnectionInformationResponse, error

Errors

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

CreateTransientToken

This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted. Note: This endpoint responds to all HTTP verbs but POST in preferred

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.General.CreateTransientToken(ctx, operations.CreateTransientTokenRequest{
        MediaType: operations.QueryParamTypeDelegation,
        Scope: operations.ScopeAll,
    })
    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.CreateTransientTokenRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.CreateTransientTokenResponse, error

Errors

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

GetLocalServers

Get a list of local servers.

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.General.GetLocalServers(ctx, operations.GetLocalServersRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDirectory != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetLocalServersResponse, error

Errors

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

BrowseFilesystem

Browse filesystem paths accessible to the server.

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.General.BrowseFilesystem(ctx, operations.BrowseFilesystemRequest{
        IncludeFiles: components.BoolIntTrue.ToPointer(),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDirectory != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.BrowseFilesystemResponse, error

Errors

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

GetBandwidthStatistics

Get dashboard bandwidth data.

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.General.GetBandwidthStatistics(ctx, operations.GetBandwidthStatisticsRequest{
        Timespan: plexgo.Pointer[int64](4),
        Lan: components.BoolIntTrue.ToPointer(),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDirectory != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetBandwidthStatisticsResponse, error

Errors

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

GetResourceStatistics

Get dashboard resource data.

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.General.GetResourceStatistics(ctx, operations.GetResourceStatisticsRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDirectory != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetResourceStatisticsResponse, error

Errors

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

GetSyncStatus

Get sync status overview.

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.General.GetSyncStatus(ctx, operations.GetSyncStatusRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithStatus != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetSyncStatusResponse, error

Errors

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

GetSyncItems

Get sync items list.

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.General.GetSyncItems(ctx, operations.GetSyncItemsRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDirectory != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetSyncItemsResponse, error

Errors

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

GetSyncQueue

Get sync queue.

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.General.GetSyncQueue(ctx, operations.GetSyncQueueRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDirectory != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetSyncQueueResponse, error

Errors

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

RefreshSyncContent

Force PMS to refresh content for known SyncLists.

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.General.RefreshSyncContent(ctx, operations.RefreshSyncContentRequest{})
    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.RefreshSyncContentRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.RefreshSyncContentResponse, error

Errors

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

RefreshSyncLists

Force PMS to download new SyncList from plex.tv.

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.General.RefreshSyncLists(ctx, operations.RefreshSyncListsRequest{})
    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.RefreshSyncListsRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.RefreshSyncListsResponse, error

Errors

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

GetSyncTranscodeQueue

Get sync transcode queue status.

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.General.GetSyncTranscodeQueue(ctx, operations.GetSyncTranscodeQueueRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDirectory != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetSyncTranscodeQueueResponse, error

Errors

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

GetMetadataAgents

Get a list of available metadata agents.

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.General.GetMetadataAgents(ctx, operations.GetMetadataAgentsRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDirectory != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetMetadataAgentsResponse, error

Errors

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

GetSystemSettings

Get system-level 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.General.GetSystemSettings(ctx, operations.GetSystemSettingsRequest{})
    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.GetSystemSettingsRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetSystemSettingsResponse, error

Errors

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

CheckForSystemUpdates

Check for available PMS updates.

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.General.CheckForSystemUpdates(ctx, operations.CheckForSystemUpdatesRequest{})
    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.CheckForSystemUpdatesRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.CheckForSystemUpdatesResponse, error

Errors

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

GetWebhooks

List configured webhook URLs for the logged-in user.

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.General.GetWebhooks(ctx, operations.GetWebhooksRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.WebhookPayload != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetWebhooksResponse, error

Errors

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

AddWebhook

Add a webhook URL for the logged-in user.

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.General.AddWebhook(ctx, operations.AddWebhookRequest{})
    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.AddWebhookRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.AddWebhookResponse, error

Errors

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

GetPlexDownloads

Get available Plex update downloads for a specific channel (e.g. plexpass, public).

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.General.GetPlexDownloads(ctx, operations.GetPlexDownloadsRequest{
        Channel: "<value>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.PlexDownloadsResponse != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetPlexDownloadsResponse, error

Errors

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

BrowseFilesystemPath

Browse a specific filesystem path.

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.General.BrowseFilesystemPath(ctx, operations.BrowseFilesystemPathRequest{
        Base64path: "<value>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDirectory != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.BrowseFilesystemPathResponse, error

Errors

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

GetSyncItem

Get sync item details.

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.General.GetSyncItem(ctx, operations.GetSyncItemRequest{
        SyncID: 761088,
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDirectory != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetSyncItemResponse, error

Errors

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

GetMetadataAgentDetails

Get details and settings for a specific metadata agent.

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.General.GetMetadataAgentDetails(ctx, operations.GetMetadataAgentDetailsRequest{
        AgentID: "<id>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithDirectory != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetMetadataAgentDetailsResponse, 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.