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

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
1095 lines (867 loc) · 54.8 KB
/

README.md

Copy path

File metadata and controls

1095 lines (867 loc) · 54.8 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Hubs

Overview

The hubs within a media provider

Available Operations

  • GetAllHubs - Get global hubs
  • GetContinueWatching - Get the continue watching hub
  • GetContinueWatchingItems - Get Continue Watching Items
  • GetHomeRecentlyAdded - Get home hubs Recently Added
  • GetHubItems - Get a hub's items
  • GetPromotedHubs - Get the hubs which are promoted
  • GetMetadataHubs - Get hubs for section by metadata item
  • GetPostplayHubs - Get postplay hubs
  • GetRelatedHubs - Get related hubs
  • GetSectionHubs - Get section hubs
  • ResetSectionDefaults - Reset hubs to defaults
  • ListHubs - Get hubs
  • CreateCustomHub - Create a custom hub
  • MoveHub - Move Hub
  • DeleteCustomHub - Delete a custom hub
  • UpdateHubVisibility - Change hub visibility

GetAllHubs

Get the global hubs in this PMS

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.Hubs.GetAllHubs(ctx, operations.GetAllHubsRequest{
        OnlyTransient: components.BoolIntTrue.ToPointer(),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithHubs != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetAllHubsResponse, error

Errors

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

GetContinueWatching

Get the global continue watching hub

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.Hubs.GetContinueWatching(ctx, operations.GetContinueWatchingRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithHubs != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetContinueWatchingResponse, error

Errors

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

GetContinueWatchingItems

Get direct access to Continue Watching items.

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

Response

*operations.GetContinueWatchingItemsResponse, error

Errors

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

GetHomeRecentlyAdded

Get the recently added hub for the home screen.

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.Hubs.GetHomeRecentlyAdded(ctx, operations.GetHomeRecentlyAddedRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithHubs != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetHomeRecentlyAddedResponse, error

Errors

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

GetHubItems

Get the items within a single hub specified by identifier

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.Hubs.GetHubItems(ctx, operations.GetHubItemsRequest{
        Identifier: []string{
            "<value 1>",
            "<value 2>",
            "<value 3>",
        },
    })
    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.GetHubItemsRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetHubItemsResponse, error

Errors

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

GetPromotedHubs

Get the global hubs which are promoted (should be displayed on the home screen)

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.Hubs.GetPromotedHubs(ctx, operations.GetPromotedHubsRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithHubs != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetPromotedHubsResponse, error

Errors

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

GetMetadataHubs

Get the hubs for a section by metadata item. Currently only for music sections

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.Hubs.GetMetadataHubs(ctx, operations.GetMetadataHubsRequest{
        MetadataID: 605482,
        OnlyTransient: components.BoolIntTrue.ToPointer(),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithHubs != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetMetadataHubsResponse, error

Errors

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

GetPostplayHubs

Get the hubs for a metadata to be displayed in post play

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.Hubs.GetPostplayHubs(ctx, operations.GetPostplayHubsRequest{
        MetadataID: 441419,
        OnlyTransient: components.BoolIntTrue.ToPointer(),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithHubs != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetPostplayHubsResponse, error

Errors

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

GetRelatedHubs

Get the hubs for a metadata related to the provided metadata item

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.Hubs.GetRelatedHubs(ctx, operations.GetRelatedHubsRequest{
        MetadataID: 8858,
        OnlyTransient: components.BoolIntTrue.ToPointer(),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithHubs != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetRelatedHubsResponse, error

Errors

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

GetSectionHubs

Get the hubs for a single section

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.Hubs.GetSectionHubs(ctx, operations.GetSectionHubsRequest{
        SectionID: 336924,
        OnlyTransient: components.BoolIntTrue.ToPointer(),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithHubs != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.GetSectionHubsResponse, error

Errors

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

ResetSectionDefaults

Reset hubs for this section to defaults and delete custom hubs

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.Hubs.ResetSectionDefaults(ctx, operations.ResetSectionDefaultsRequest{
        SectionID: 383022,
    })
    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.ResetSectionDefaultsRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.ResetSectionDefaultsResponse, error

Errors

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

ListHubs

Get the list of hubs including both built-in and custom

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.Hubs.ListHubs(ctx, operations.ListHubsRequest{
        SectionID: 442546,
    })
    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.ListHubsRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.ListHubsResponse, error

Errors

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

CreateCustomHub

Create a custom hub based on a metadata item

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.Hubs.CreateCustomHub(ctx, operations.CreateCustomHubRequest{
        SectionID: 869922,
        MetadataItemID: 703843,
        PromotedToRecommended: components.BoolIntTrue.ToPointer(),
        PromotedToOwnHome: components.BoolIntTrue.ToPointer(),
        PromotedToSharedHome: components.BoolIntTrue.ToPointer(),
    })
    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.CreateCustomHubRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.CreateCustomHubResponse, error

Errors

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

MoveHub

Changed the ordering of a hub among others hubs

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.Hubs.MoveHub(ctx, operations.MoveHubRequest{
        SectionID: 755710,
        Identifier: "<value>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.GetResponses200 != nil {
        // handle response
    }
}

Parameters

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

Response

*operations.MoveHubResponse, error

Errors

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

DeleteCustomHub

Delete a custom hub from 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.Hubs.DeleteCustomHub(ctx, operations.DeleteCustomHubRequest{
        SectionID: 625677,
        Identifier: "<value>",
    })
    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.DeleteCustomHubRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.DeleteCustomHubResponse, error

Errors

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

UpdateHubVisibility

Changed the visibility of a hub for both the admin and shared users

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.Hubs.UpdateHubVisibility(ctx, operations.UpdateHubVisibilityRequest{
        SectionID: 341650,
        Identifier: "<value>",
        PromotedToRecommended: components.BoolIntTrue.ToPointer(),
        PromotedToOwnHome: components.BoolIntTrue.ToPointer(),
        PromotedToSharedHome: components.BoolIntTrue.ToPointer(),
    })
    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.UpdateHubVisibilityRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.UpdateHubVisibilityResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*
You are visitor 01402809 — 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.