mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
320 lines
7.3 KiB
Go
320 lines
7.3 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 GetTokenByPinIDServerList = []string{
|
|
"https://plex.tv/api/v2/",
|
|
}
|
|
|
|
type GetTokenByPinIDGlobals struct {
|
|
// The unique identifier for the client application
|
|
// This is used to track the client application and its usage
|
|
// (UUID, serial number, or other number unique per device)
|
|
//
|
|
ClientID *string `queryParam:"style=form,explode=true,name=X-Plex-Client-Identifier"`
|
|
}
|
|
|
|
func (o *GetTokenByPinIDGlobals) GetClientID() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ClientID
|
|
}
|
|
|
|
type GetTokenByPinIDRequest struct {
|
|
// The unique identifier for the client application
|
|
// This is used to track the client application and its usage
|
|
// (UUID, serial number, or other number unique per device)
|
|
//
|
|
ClientID *string `queryParam:"style=form,explode=true,name=X-Plex-Client-Identifier"`
|
|
// The PinID to retrieve an access token for
|
|
PinID int64 `pathParam:"style=simple,explode=false,name=pinID"`
|
|
}
|
|
|
|
func (o *GetTokenByPinIDRequest) GetClientID() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ClientID
|
|
}
|
|
|
|
func (o *GetTokenByPinIDRequest) GetPinID() int64 {
|
|
if o == nil {
|
|
return 0
|
|
}
|
|
return o.PinID
|
|
}
|
|
|
|
// GetTokenByPinIDGeoData - Geo location data
|
|
type GetTokenByPinIDGeoData 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 GetTokenByPinIDGeoData) MarshalJSON() ([]byte, error) {
|
|
return utils.MarshalJSON(g, "", false)
|
|
}
|
|
|
|
func (g *GetTokenByPinIDGeoData) UnmarshalJSON(data []byte) error {
|
|
if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetTokenByPinIDGeoData) GetCode() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Code
|
|
}
|
|
|
|
func (o *GetTokenByPinIDGeoData) GetContinentCode() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.ContinentCode
|
|
}
|
|
|
|
func (o *GetTokenByPinIDGeoData) GetCountry() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Country
|
|
}
|
|
|
|
func (o *GetTokenByPinIDGeoData) GetCity() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.City
|
|
}
|
|
|
|
func (o *GetTokenByPinIDGeoData) GetEuropeanUnionMember() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.EuropeanUnionMember
|
|
}
|
|
|
|
func (o *GetTokenByPinIDGeoData) GetTimeZone() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.TimeZone
|
|
}
|
|
|
|
func (o *GetTokenByPinIDGeoData) GetPostalCode() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.PostalCode
|
|
}
|
|
|
|
func (o *GetTokenByPinIDGeoData) GetInPrivacyRestrictedCountry() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.InPrivacyRestrictedCountry
|
|
}
|
|
|
|
func (o *GetTokenByPinIDGeoData) GetInPrivacyRestrictedRegion() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.InPrivacyRestrictedRegion
|
|
}
|
|
|
|
func (o *GetTokenByPinIDGeoData) GetSubdivisions() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Subdivisions
|
|
}
|
|
|
|
func (o *GetTokenByPinIDGeoData) GetCoordinates() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Coordinates
|
|
}
|
|
|
|
// GetTokenByPinIDAuthPinContainer - The Pin with a non-null authToken when it has been verified by the user
|
|
type GetTokenByPinIDAuthPinContainer 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 GetTokenByPinIDGeoData `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 GetTokenByPinIDAuthPinContainer) MarshalJSON() ([]byte, error) {
|
|
return utils.MarshalJSON(g, "", false)
|
|
}
|
|
|
|
func (g *GetTokenByPinIDAuthPinContainer) UnmarshalJSON(data []byte) error {
|
|
if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetTokenByPinIDAuthPinContainer) GetID() int64 {
|
|
if o == nil {
|
|
return 0
|
|
}
|
|
return o.ID
|
|
}
|
|
|
|
func (o *GetTokenByPinIDAuthPinContainer) GetCode() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Code
|
|
}
|
|
|
|
func (o *GetTokenByPinIDAuthPinContainer) GetProduct() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Product
|
|
}
|
|
|
|
func (o *GetTokenByPinIDAuthPinContainer) GetTrusted() *bool {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Trusted
|
|
}
|
|
|
|
func (o *GetTokenByPinIDAuthPinContainer) GetQr() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Qr
|
|
}
|
|
|
|
func (o *GetTokenByPinIDAuthPinContainer) GetClientIdentifier() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.ClientIdentifier
|
|
}
|
|
|
|
func (o *GetTokenByPinIDAuthPinContainer) GetLocation() GetTokenByPinIDGeoData {
|
|
if o == nil {
|
|
return GetTokenByPinIDGeoData{}
|
|
}
|
|
return o.Location
|
|
}
|
|
|
|
func (o *GetTokenByPinIDAuthPinContainer) GetExpiresIn() *int64 {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ExpiresIn
|
|
}
|
|
|
|
func (o *GetTokenByPinIDAuthPinContainer) GetCreatedAt() time.Time {
|
|
if o == nil {
|
|
return time.Time{}
|
|
}
|
|
return o.CreatedAt
|
|
}
|
|
|
|
func (o *GetTokenByPinIDAuthPinContainer) GetExpiresAt() time.Time {
|
|
if o == nil {
|
|
return time.Time{}
|
|
}
|
|
return o.ExpiresAt
|
|
}
|
|
|
|
func (o *GetTokenByPinIDAuthPinContainer) GetAuthToken() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.AuthToken
|
|
}
|
|
|
|
func (o *GetTokenByPinIDAuthPinContainer) GetNewRegistration() any {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.NewRegistration
|
|
}
|
|
|
|
type GetTokenByPinIDResponse 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
|
|
// The Pin with a non-null authToken when it has been verified by the user
|
|
AuthPinContainer *GetTokenByPinIDAuthPinContainer
|
|
}
|
|
|
|
func (o *GetTokenByPinIDResponse) GetContentType() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.ContentType
|
|
}
|
|
|
|
func (o *GetTokenByPinIDResponse) GetStatusCode() int {
|
|
if o == nil {
|
|
return 0
|
|
}
|
|
return o.StatusCode
|
|
}
|
|
|
|
func (o *GetTokenByPinIDResponse) GetRawResponse() *http.Response {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.RawResponse
|
|
}
|
|
|
|
func (o *GetTokenByPinIDResponse) GetAuthPinContainer() *GetTokenByPinIDAuthPinContainer {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.AuthPinContainer
|
|
}
|