mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
400 lines
8.9 KiB
Go
400 lines
8.9 KiB
Go
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
|
|
package operations
|
|
|
|
import (
|
|
"github.com/LukeHagar/plexgo/internal/utils"
|
|
"net/http"
|
|
"time"
|
|
)
|
|
|
|
var GetPinServerList = []string{
|
|
"https://plex.tv/api/v2",
|
|
}
|
|
|
|
type GetPinGlobals struct {
|
|
// An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
|
ClientID *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
|
|
// The name of the client application. (Plex Web, Plex Media Server, etc.)
|
|
ClientName *string `header:"style=simple,explode=false,name=X-Plex-Product"`
|
|
// A relatively friendly name for the client device
|
|
DeviceNickname *string `header:"style=simple,explode=false,name=X-Plex-Device"`
|
|
// The version of the client application.
|
|
ClientVersion *string `header:"style=simple,explode=false,name=X-Plex-Version"`
|
|
// The platform of the client application.
|
|
Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"`
|
|
}
|
|
|
|
func (o *GetPinGlobals) GetClientID() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ClientID
|
|
}
|
|
|
|
func (o *GetPinGlobals) GetClientName() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ClientName
|
|
}
|
|
|
|
func (o *GetPinGlobals) GetDeviceNickname() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.DeviceNickname
|
|
}
|
|
|
|
func (o *GetPinGlobals) GetClientVersion() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ClientVersion
|
|
}
|
|
|
|
func (o *GetPinGlobals) GetPlatform() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Platform
|
|
}
|
|
|
|
type GetPinRequest struct {
|
|
// Determines the kind of code returned by the API call
|
|
// Strong codes are used for Pin authentication flows
|
|
// Non-Strong codes are used for `Plex.tv/link`
|
|
//
|
|
Strong *bool `default:"false" queryParam:"style=form,explode=true,name=strong"`
|
|
// An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
|
ClientID *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
|
|
// The name of the client application. (Plex Web, Plex Media Server, etc.)
|
|
ClientName *string `header:"style=simple,explode=false,name=X-Plex-Product"`
|
|
// A relatively friendly name for the client device
|
|
DeviceNickname *string `header:"style=simple,explode=false,name=X-Plex-Device"`
|
|
// The version of the client application.
|
|
ClientVersion *string `header:"style=simple,explode=false,name=X-Plex-Version"`
|
|
// The platform of the client application.
|
|
Platform *string `header:"style=simple,explode=false,name=X-Plex-Platform"`
|
|
}
|
|
|
|
func (g GetPinRequest) MarshalJSON() ([]byte, error) {
|
|
return utils.MarshalJSON(g, "", false)
|
|
}
|
|
|
|
func (g *GetPinRequest) UnmarshalJSON(data []byte) error {
|
|
if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetPinRequest) GetStrong() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Strong
|
|
}
|
|
|
|
func (o *GetPinRequest) GetClientID() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ClientID
|
|
}
|
|
|
|
func (o *GetPinRequest) GetClientName() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ClientName
|
|
}
|
|
|
|
func (o *GetPinRequest) GetDeviceNickname() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.DeviceNickname
|
|
}
|
|
|
|
func (o *GetPinRequest) GetClientVersion() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ClientVersion
|
|
}
|
|
|
|
func (o *GetPinRequest) GetPlatform() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Platform
|
|
}
|
|
|
|
// GeoData - Geo location data
|
|
type GeoData struct {
|
|
// The ISO 3166-1 alpha-2 code of the country.
|
|
Code string `json:"code"`
|
|
// The continent code where the country is located.
|
|
ContinentCode string `json:"continent_code"`
|
|
// The official name of the country.
|
|
Country string `json:"country"`
|
|
// The name of the city.
|
|
City string `json:"city"`
|
|
// Indicates if the country is a member of the European Union.
|
|
EuropeanUnionMember *bool `default:"false" json:"european_union_member"`
|
|
// The time zone of the country.
|
|
TimeZone string `json:"time_zone"`
|
|
// The postal code of the location.
|
|
PostalCode string `json:"postal_code"`
|
|
// Indicates if the country has privacy restrictions.
|
|
InPrivacyRestrictedCountry *bool `default:"false" json:"in_privacy_restricted_country"`
|
|
// Indicates if the region has privacy restrictions.
|
|
InPrivacyRestrictedRegion *bool `default:"false" json:"in_privacy_restricted_region"`
|
|
// The name of the primary administrative subdivision.
|
|
Subdivisions string `json:"subdivisions"`
|
|
// The geographical coordinates (latitude, longitude) of the location.
|
|
Coordinates string `json:"coordinates"`
|
|
}
|
|
|
|
func (g GeoData) MarshalJSON() ([]byte, error) {
|
|
return utils.MarshalJSON(g, "", false)
|
|
}
|
|
|
|
func (g *GeoData) UnmarshalJSON(data []byte) error {
|
|
if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GeoData) GetCode() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Code
|
|
}
|
|
|
|
func (o *GeoData) GetContinentCode() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.ContinentCode
|
|
}
|
|
|
|
func (o *GeoData) GetCountry() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Country
|
|
}
|
|
|
|
func (o *GeoData) GetCity() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.City
|
|
}
|
|
|
|
func (o *GeoData) GetEuropeanUnionMember() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.EuropeanUnionMember
|
|
}
|
|
|
|
func (o *GeoData) GetTimeZone() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.TimeZone
|
|
}
|
|
|
|
func (o *GeoData) GetPostalCode() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.PostalCode
|
|
}
|
|
|
|
func (o *GeoData) GetInPrivacyRestrictedCountry() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.InPrivacyRestrictedCountry
|
|
}
|
|
|
|
func (o *GeoData) GetInPrivacyRestrictedRegion() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.InPrivacyRestrictedRegion
|
|
}
|
|
|
|
func (o *GeoData) GetSubdivisions() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Subdivisions
|
|
}
|
|
|
|
func (o *GeoData) GetCoordinates() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Coordinates
|
|
}
|
|
|
|
// GetPinAuthPinContainer - Requests a new pin id used in the authentication flow
|
|
type GetPinAuthPinContainer struct {
|
|
ID int64 `json:"id"`
|
|
Code string `json:"code"`
|
|
Product string `json:"product"`
|
|
Trusted *bool `default:"false" json:"trusted"`
|
|
Qr string `json:"qr"`
|
|
// The X-Client-Identifier used in the request
|
|
ClientIdentifier string `json:"clientIdentifier"`
|
|
// Geo location data
|
|
Location GeoData `json:"location"`
|
|
// The number of seconds this pin expires, by default 900 seconds
|
|
ExpiresIn *int64 `default:"900" json:"expiresIn"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
ExpiresAt time.Time `json:"expiresAt"`
|
|
AuthToken *string `json:"authToken,omitempty"`
|
|
NewRegistration any `json:"newRegistration,omitempty"`
|
|
}
|
|
|
|
func (g GetPinAuthPinContainer) MarshalJSON() ([]byte, error) {
|
|
return utils.MarshalJSON(g, "", false)
|
|
}
|
|
|
|
func (g *GetPinAuthPinContainer) UnmarshalJSON(data []byte) error {
|
|
if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetPinAuthPinContainer) GetID() int64 {
|
|
if o == nil {
|
|
return 0
|
|
}
|
|
return o.ID
|
|
}
|
|
|
|
func (o *GetPinAuthPinContainer) GetCode() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Code
|
|
}
|
|
|
|
func (o *GetPinAuthPinContainer) GetProduct() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Product
|
|
}
|
|
|
|
func (o *GetPinAuthPinContainer) GetTrusted() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Trusted
|
|
}
|
|
|
|
func (o *GetPinAuthPinContainer) GetQr() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Qr
|
|
}
|
|
|
|
func (o *GetPinAuthPinContainer) GetClientIdentifier() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.ClientIdentifier
|
|
}
|
|
|
|
func (o *GetPinAuthPinContainer) GetLocation() GeoData {
|
|
if o == nil {
|
|
return GeoData{}
|
|
}
|
|
return o.Location
|
|
}
|
|
|
|
func (o *GetPinAuthPinContainer) GetExpiresIn() *int64 {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ExpiresIn
|
|
}
|
|
|
|
func (o *GetPinAuthPinContainer) GetCreatedAt() time.Time {
|
|
if o == nil {
|
|
return time.Time{}
|
|
}
|
|
return o.CreatedAt
|
|
}
|
|
|
|
func (o *GetPinAuthPinContainer) GetExpiresAt() time.Time {
|
|
if o == nil {
|
|
return time.Time{}
|
|
}
|
|
return o.ExpiresAt
|
|
}
|
|
|
|
func (o *GetPinAuthPinContainer) GetAuthToken() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.AuthToken
|
|
}
|
|
|
|
func (o *GetPinAuthPinContainer) GetNewRegistration() any {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.NewRegistration
|
|
}
|
|
|
|
type GetPinResponse struct {
|
|
// HTTP response content type for this operation
|
|
ContentType string
|
|
// HTTP response status code for this operation
|
|
StatusCode int
|
|
// Raw HTTP response; suitable for custom response parsing
|
|
RawResponse *http.Response
|
|
// Requests a new pin id used in the authentication flow
|
|
AuthPinContainer *GetPinAuthPinContainer
|
|
}
|
|
|
|
func (o *GetPinResponse) GetContentType() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.ContentType
|
|
}
|
|
|
|
func (o *GetPinResponse) GetStatusCode() int {
|
|
if o == nil {
|
|
return 0
|
|
}
|
|
return o.StatusCode
|
|
}
|
|
|
|
func (o *GetPinResponse) GetRawResponse() *http.Response {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.RawResponse
|
|
}
|
|
|
|
func (o *GetPinResponse) GetAuthPinContainer() *GetPinAuthPinContainer {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.AuthPinContainer
|
|
}
|