# General (*General*) ## Overview General endpoints for basic PMS operation not specific to any media provider ### Available Operations * [GetServerInfo](#getserverinfo) - Get PMS info * [GetIdentity](#getidentity) - Get PMS identity * [GetSourceConnectionInformation](#getsourceconnectioninformation) - Get Source Connection Information * [GetTransientToken](#gettransienttoken) - Get Transient Tokens ## GetServerInfo Information about this PMS setup and configuration ### Example Usage ```go package main import( "context" "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithAccepts(components.AcceptsApplicationXML), plexgo.WithClientIdentifier("abc123"), plexgo.WithProduct("Plex for Roku"), plexgo.WithVersion("2.4.1"), plexgo.WithPlatform("Roku"), plexgo.WithPlatformVersion("4.3 build 1057"), plexgo.WithDevice("Roku 3"), plexgo.WithModel("4200X"), plexgo.WithDeviceVendor("Roku"), plexgo.WithDeviceName("Living Room TV"), plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) res, err := s.General.GetServerInfo(ctx, operations.GetServerInfoRequest{}) if err != nil { log.Fatal(err) } if res.MediaContainerWithDirectory != nil { // handle response } } ``` ### Parameters | Parameter | Type | Required | Description | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `request` | [operations.GetServerInfoRequest](../../models/operations/getserverinforequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response **[*operations.GetServerInfoResponse](../../models/operations/getserverinforesponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## GetIdentity Get details about this PMS's identity ### Example Usage ```go 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](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response **[*operations.GetIdentityResponse](../../models/operations/getidentityresponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | 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 ```go package main import( "context" "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithAccepts(components.AcceptsApplicationXML), plexgo.WithClientIdentifier("abc123"), plexgo.WithProduct("Plex for Roku"), plexgo.WithVersion("2.4.1"), plexgo.WithPlatform("Roku"), plexgo.WithPlatformVersion("4.3 build 1057"), plexgo.WithDevice("Roku 3"), plexgo.WithModel("4200X"), plexgo.WithDeviceVendor("Roku"), plexgo.WithDeviceName("Living Room TV"), plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) res, err := s.General.GetSourceConnectionInformation(ctx, operations.GetSourceConnectionInformationRequest{ Source: "server://client-identifier", Refresh: components.BoolIntOne.ToPointer(), }) if err != nil { log.Fatal(err) } if res.Object != nil { // handle response } } ``` ### Parameters | Parameter | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `request` | [operations.GetSourceConnectionInformationRequest](../../models/operations/getsourceconnectioninformationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response **[*operations.GetSourceConnectionInformationResponse](../../models/operations/getsourceconnectioninformationresponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## GetTransientToken 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 ```go package main import( "context" "github.com/LukeHagar/plexgo/models/components" "github.com/LukeHagar/plexgo" "github.com/LukeHagar/plexgo/models/operations" "log" ) func main() { ctx := context.Background() s := plexgo.New( plexgo.WithAccepts(components.AcceptsApplicationXML), plexgo.WithClientIdentifier("abc123"), plexgo.WithProduct("Plex for Roku"), plexgo.WithVersion("2.4.1"), plexgo.WithPlatform("Roku"), plexgo.WithPlatformVersion("4.3 build 1057"), plexgo.WithDevice("Roku 3"), plexgo.WithModel("4200X"), plexgo.WithDeviceVendor("Roku"), plexgo.WithDeviceName("Living Room TV"), plexgo.WithMarketplace("googlePlay"), plexgo.WithSecurity(""), ) res, err := s.General.GetTransientToken(ctx, operations.GetTransientTokenRequest{ Type: 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](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `request` | [operations.GetTransientTokenRequest](../../models/operations/gettransienttokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response **[*operations.GetTransientTokenResponse](../../models/operations/gettransienttokenresponse.md), error** ### Errors | Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4XX, 5XX | \*/\* |