mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
352 lines
7.9 KiB
Go
352 lines
7.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 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, []string{"X-Plex-Client-Identifier"}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (g *GetPinRequest) GetStrong() *bool {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.Strong
|
|
}
|
|
|
|
func (g *GetPinRequest) GetClientID() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.ClientID
|
|
}
|
|
|
|
func (g *GetPinRequest) GetClientName() *string {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.ClientName
|
|
}
|
|
|
|
func (g *GetPinRequest) GetDeviceNickname() *string {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.DeviceNickname
|
|
}
|
|
|
|
func (g *GetPinRequest) GetClientVersion() *string {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.ClientVersion
|
|
}
|
|
|
|
func (g *GetPinRequest) GetPlatform() *string {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.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, []string{"code", "continent_code", "country", "city", "time_zone", "postal_code", "subdivisions", "coordinates"}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (g *GeoData) GetCode() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.Code
|
|
}
|
|
|
|
func (g *GeoData) GetContinentCode() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.ContinentCode
|
|
}
|
|
|
|
func (g *GeoData) GetCountry() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.Country
|
|
}
|
|
|
|
func (g *GeoData) GetCity() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.City
|
|
}
|
|
|
|
func (g *GeoData) GetEuropeanUnionMember() *bool {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.EuropeanUnionMember
|
|
}
|
|
|
|
func (g *GeoData) GetTimeZone() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.TimeZone
|
|
}
|
|
|
|
func (g *GeoData) GetPostalCode() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.PostalCode
|
|
}
|
|
|
|
func (g *GeoData) GetInPrivacyRestrictedCountry() *bool {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.InPrivacyRestrictedCountry
|
|
}
|
|
|
|
func (g *GeoData) GetInPrivacyRestrictedRegion() *bool {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.InPrivacyRestrictedRegion
|
|
}
|
|
|
|
func (g *GeoData) GetSubdivisions() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.Subdivisions
|
|
}
|
|
|
|
func (g *GeoData) GetCoordinates() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.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, []string{"id", "code", "product", "qr", "clientIdentifier", "location", "createdAt", "expiresAt"}); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (g *GetPinAuthPinContainer) GetID() int64 {
|
|
if g == nil {
|
|
return 0
|
|
}
|
|
return g.ID
|
|
}
|
|
|
|
func (g *GetPinAuthPinContainer) GetCode() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.Code
|
|
}
|
|
|
|
func (g *GetPinAuthPinContainer) GetProduct() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.Product
|
|
}
|
|
|
|
func (g *GetPinAuthPinContainer) GetTrusted() *bool {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.Trusted
|
|
}
|
|
|
|
func (g *GetPinAuthPinContainer) GetQr() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.Qr
|
|
}
|
|
|
|
func (g *GetPinAuthPinContainer) GetClientIdentifier() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.ClientIdentifier
|
|
}
|
|
|
|
func (g *GetPinAuthPinContainer) GetLocation() GeoData {
|
|
if g == nil {
|
|
return GeoData{}
|
|
}
|
|
return g.Location
|
|
}
|
|
|
|
func (g *GetPinAuthPinContainer) GetExpiresIn() *int64 {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.ExpiresIn
|
|
}
|
|
|
|
func (g *GetPinAuthPinContainer) GetCreatedAt() time.Time {
|
|
if g == nil {
|
|
return time.Time{}
|
|
}
|
|
return g.CreatedAt
|
|
}
|
|
|
|
func (g *GetPinAuthPinContainer) GetExpiresAt() time.Time {
|
|
if g == nil {
|
|
return time.Time{}
|
|
}
|
|
return g.ExpiresAt
|
|
}
|
|
|
|
func (g *GetPinAuthPinContainer) GetAuthToken() *string {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.AuthToken
|
|
}
|
|
|
|
func (g *GetPinAuthPinContainer) GetNewRegistration() any {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.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 (g *GetPinResponse) GetContentType() string {
|
|
if g == nil {
|
|
return ""
|
|
}
|
|
return g.ContentType
|
|
}
|
|
|
|
func (g *GetPinResponse) GetStatusCode() int {
|
|
if g == nil {
|
|
return 0
|
|
}
|
|
return g.StatusCode
|
|
}
|
|
|
|
func (g *GetPinResponse) GetRawResponse() *http.Response {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.RawResponse
|
|
}
|
|
|
|
func (g *GetPinResponse) GetAuthPinContainer() *GetPinAuthPinContainer {
|
|
if g == nil {
|
|
return nil
|
|
}
|
|
return g.AuthPinContainer
|
|
}
|