Files
plexterraform/internal/sdk/models/operations/gettoken.go

339 lines
7.4 KiB
Go

// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package operations
import (
"github.com/LukeHagar/terraform-provider-PlexAPI/internal/sdk/internal/utils"
"net/http"
"time"
)
var GetTokenServerList = []string{
"https://plex.tv/api/v2",
}
type GetTokenGlobals 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)
//
XPlexClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
}
func (o *GetTokenGlobals) GetXPlexClientIdentifier() *string {
if o == nil {
return nil
}
return o.XPlexClientIdentifier
}
type GetTokenRequest struct {
// The PinID to retrieve an access token for
PinID string `pathParam:"style=simple,explode=false,name=pinID"`
// 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)
//
XPlexClientIdentifier *string `header:"style=simple,explode=false,name=X-Plex-Client-Identifier"`
}
func (o *GetTokenRequest) GetPinID() string {
if o == nil {
return ""
}
return o.PinID
}
func (o *GetTokenRequest) GetXPlexClientIdentifier() *string {
if o == nil {
return nil
}
return o.XPlexClientIdentifier
}
type GetTokenErrors struct {
Code *float64 `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Status *float64 `json:"status,omitempty"`
}
func (o *GetTokenErrors) GetCode() *float64 {
if o == nil {
return nil
}
return o.Code
}
func (o *GetTokenErrors) GetMessage() *string {
if o == nil {
return nil
}
return o.Message
}
func (o *GetTokenErrors) GetStatus() *float64 {
if o == nil {
return nil
}
return o.Status
}
// GetTokenPlexResponseBody - X-Plex-Client-Identifier is missing
type GetTokenPlexResponseBody struct {
Errors []GetTokenErrors `json:"errors,omitempty"`
}
func (o *GetTokenPlexResponseBody) GetErrors() []GetTokenErrors {
if o == nil {
return nil
}
return o.Errors
}
type GetTokenLocation struct {
Code *string `json:"code,omitempty"`
EuropeanUnionMember *bool `json:"european_union_member,omitempty"`
ContinentCode *string `json:"continent_code,omitempty"`
Country *string `json:"country,omitempty"`
City *string `json:"city,omitempty"`
TimeZone *string `json:"time_zone,omitempty"`
PostalCode *string `json:"postal_code,omitempty"`
InPrivacyRestrictedCountry *bool `json:"in_privacy_restricted_country,omitempty"`
Subdivisions *string `json:"subdivisions,omitempty"`
Coordinates *string `json:"coordinates,omitempty"`
}
func (o *GetTokenLocation) GetCode() *string {
if o == nil {
return nil
}
return o.Code
}
func (o *GetTokenLocation) GetEuropeanUnionMember() *bool {
if o == nil {
return nil
}
return o.EuropeanUnionMember
}
func (o *GetTokenLocation) GetContinentCode() *string {
if o == nil {
return nil
}
return o.ContinentCode
}
func (o *GetTokenLocation) GetCountry() *string {
if o == nil {
return nil
}
return o.Country
}
func (o *GetTokenLocation) GetCity() *string {
if o == nil {
return nil
}
return o.City
}
func (o *GetTokenLocation) GetTimeZone() *string {
if o == nil {
return nil
}
return o.TimeZone
}
func (o *GetTokenLocation) GetPostalCode() *string {
if o == nil {
return nil
}
return o.PostalCode
}
func (o *GetTokenLocation) GetInPrivacyRestrictedCountry() *bool {
if o == nil {
return nil
}
return o.InPrivacyRestrictedCountry
}
func (o *GetTokenLocation) GetSubdivisions() *string {
if o == nil {
return nil
}
return o.Subdivisions
}
func (o *GetTokenLocation) GetCoordinates() *string {
if o == nil {
return nil
}
return o.Coordinates
}
// GetTokenResponseBody - Access Token
type GetTokenResponseBody struct {
// PinID for use with authentication
ID *float64 `json:"id,omitempty"`
Code *string `json:"code,omitempty"`
Product *string `json:"product,omitempty"`
Trusted *bool `json:"trusted,omitempty"`
// a link to a QR code hosted on plex.tv
// The QR code redirects to the relevant `plex.tv/link` authentication page
// Which then prompts the user for the 4 Digit Link Pin
//
Qr *string `json:"qr,omitempty"`
ClientIdentifier *string `json:"clientIdentifier,omitempty"`
Location *GetTokenLocation `json:"location,omitempty"`
ExpiresIn *float64 `json:"expiresIn,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
AuthToken *string `json:"authToken,omitempty"`
NewRegistration *string `json:"newRegistration,omitempty"`
}
func (g GetTokenResponseBody) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(g, "", false)
}
func (g *GetTokenResponseBody) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil {
return err
}
return nil
}
func (o *GetTokenResponseBody) GetID() *float64 {
if o == nil {
return nil
}
return o.ID
}
func (o *GetTokenResponseBody) GetCode() *string {
if o == nil {
return nil
}
return o.Code
}
func (o *GetTokenResponseBody) GetProduct() *string {
if o == nil {
return nil
}
return o.Product
}
func (o *GetTokenResponseBody) GetTrusted() *bool {
if o == nil {
return nil
}
return o.Trusted
}
func (o *GetTokenResponseBody) GetQr() *string {
if o == nil {
return nil
}
return o.Qr
}
func (o *GetTokenResponseBody) GetClientIdentifier() *string {
if o == nil {
return nil
}
return o.ClientIdentifier
}
func (o *GetTokenResponseBody) GetLocation() *GetTokenLocation {
if o == nil {
return nil
}
return o.Location
}
func (o *GetTokenResponseBody) GetExpiresIn() *float64 {
if o == nil {
return nil
}
return o.ExpiresIn
}
func (o *GetTokenResponseBody) GetCreatedAt() *time.Time {
if o == nil {
return nil
}
return o.CreatedAt
}
func (o *GetTokenResponseBody) GetExpiresAt() *time.Time {
if o == nil {
return nil
}
return o.ExpiresAt
}
func (o *GetTokenResponseBody) GetAuthToken() *string {
if o == nil {
return nil
}
return o.AuthToken
}
func (o *GetTokenResponseBody) GetNewRegistration() *string {
if o == nil {
return nil
}
return o.NewRegistration
}
type GetTokenResponse 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
// Access Token
TwoHundredApplicationJSONObject *GetTokenResponseBody
// X-Plex-Client-Identifier is missing
FourHundredApplicationJSONObject *GetTokenPlexResponseBody
}
func (o *GetTokenResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}
func (o *GetTokenResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}
func (o *GetTokenResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}
func (o *GetTokenResponse) GetTwoHundredApplicationJSONObject() *GetTokenResponseBody {
if o == nil {
return nil
}
return o.TwoHundredApplicationJSONObject
}
func (o *GetTokenResponse) GetFourHundredApplicationJSONObject() *GetTokenPlexResponseBody {
if o == nil {
return nil
}
return o.FourHundredApplicationJSONObject
}