mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
573 lines
16 KiB
Go
573 lines
16 KiB
Go
/*
|
|
Plex-API
|
|
|
|
An Open API Spec for interacting with Plex.tv
|
|
|
|
API version: 0.0.3
|
|
Contact: Lukeslakemail@gmail.com
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package plextv
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the GetPin200Response type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GetPin200Response{}
|
|
|
|
// GetPin200Response struct for GetPin200Response
|
|
type GetPin200Response struct {
|
|
// PinID for use with authentication
|
|
Id interface{} `json:"id,omitempty"`
|
|
Code interface{} `json:"code,omitempty"`
|
|
Product interface{} `json:"product,omitempty"`
|
|
Trusted interface{} `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 interface{} `json:"qr,omitempty"`
|
|
ClientIdentifier interface{} `json:"clientIdentifier,omitempty"`
|
|
Location *GetPin200ResponseLocation `json:"location,omitempty"`
|
|
ExpiresIn interface{} `json:"expiresIn,omitempty"`
|
|
CreatedAt interface{} `json:"createdAt,omitempty"`
|
|
ExpiresAt interface{} `json:"expiresAt,omitempty"`
|
|
AuthToken interface{} `json:"authToken,omitempty"`
|
|
NewRegistration interface{} `json:"newRegistration,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GetPin200Response GetPin200Response
|
|
|
|
// NewGetPin200Response instantiates a new GetPin200Response object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewGetPin200Response() *GetPin200Response {
|
|
this := GetPin200Response{}
|
|
return &this
|
|
}
|
|
|
|
// NewGetPin200ResponseWithDefaults instantiates a new GetPin200Response object
|
|
// This constructor will only assign default values to properties that have it defined,
|
|
// but it doesn't guarantee that properties required by API are set
|
|
func NewGetPin200ResponseWithDefaults() *GetPin200Response {
|
|
this := GetPin200Response{}
|
|
return &this
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *GetPin200Response) GetId() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Id
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *GetPin200Response) GetIdOk() (*interface{}, bool) {
|
|
if o == nil || isNil(o.Id) {
|
|
return nil, false
|
|
}
|
|
return &o.Id, true
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *GetPin200Response) HasId() bool {
|
|
if o != nil && isNil(o.Id) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetId gets a reference to the given interface{} and assigns it to the Id field.
|
|
func (o *GetPin200Response) SetId(v interface{}) {
|
|
o.Id = v
|
|
}
|
|
|
|
// GetCode returns the Code field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *GetPin200Response) GetCode() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Code
|
|
}
|
|
|
|
// GetCodeOk returns a tuple with the Code field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *GetPin200Response) GetCodeOk() (*interface{}, bool) {
|
|
if o == nil || isNil(o.Code) {
|
|
return nil, false
|
|
}
|
|
return &o.Code, true
|
|
}
|
|
|
|
// HasCode returns a boolean if a field has been set.
|
|
func (o *GetPin200Response) HasCode() bool {
|
|
if o != nil && isNil(o.Code) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCode gets a reference to the given interface{} and assigns it to the Code field.
|
|
func (o *GetPin200Response) SetCode(v interface{}) {
|
|
o.Code = v
|
|
}
|
|
|
|
// GetProduct returns the Product field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *GetPin200Response) GetProduct() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Product
|
|
}
|
|
|
|
// GetProductOk returns a tuple with the Product field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *GetPin200Response) GetProductOk() (*interface{}, bool) {
|
|
if o == nil || isNil(o.Product) {
|
|
return nil, false
|
|
}
|
|
return &o.Product, true
|
|
}
|
|
|
|
// HasProduct returns a boolean if a field has been set.
|
|
func (o *GetPin200Response) HasProduct() bool {
|
|
if o != nil && isNil(o.Product) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetProduct gets a reference to the given interface{} and assigns it to the Product field.
|
|
func (o *GetPin200Response) SetProduct(v interface{}) {
|
|
o.Product = v
|
|
}
|
|
|
|
// GetTrusted returns the Trusted field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *GetPin200Response) GetTrusted() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Trusted
|
|
}
|
|
|
|
// GetTrustedOk returns a tuple with the Trusted field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *GetPin200Response) GetTrustedOk() (*interface{}, bool) {
|
|
if o == nil || isNil(o.Trusted) {
|
|
return nil, false
|
|
}
|
|
return &o.Trusted, true
|
|
}
|
|
|
|
// HasTrusted returns a boolean if a field has been set.
|
|
func (o *GetPin200Response) HasTrusted() bool {
|
|
if o != nil && isNil(o.Trusted) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTrusted gets a reference to the given interface{} and assigns it to the Trusted field.
|
|
func (o *GetPin200Response) SetTrusted(v interface{}) {
|
|
o.Trusted = v
|
|
}
|
|
|
|
// GetQr returns the Qr field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *GetPin200Response) GetQr() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Qr
|
|
}
|
|
|
|
// GetQrOk returns a tuple with the Qr field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *GetPin200Response) GetQrOk() (*interface{}, bool) {
|
|
if o == nil || isNil(o.Qr) {
|
|
return nil, false
|
|
}
|
|
return &o.Qr, true
|
|
}
|
|
|
|
// HasQr returns a boolean if a field has been set.
|
|
func (o *GetPin200Response) HasQr() bool {
|
|
if o != nil && isNil(o.Qr) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetQr gets a reference to the given interface{} and assigns it to the Qr field.
|
|
func (o *GetPin200Response) SetQr(v interface{}) {
|
|
o.Qr = v
|
|
}
|
|
|
|
// GetClientIdentifier returns the ClientIdentifier field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *GetPin200Response) GetClientIdentifier() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.ClientIdentifier
|
|
}
|
|
|
|
// GetClientIdentifierOk returns a tuple with the ClientIdentifier field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *GetPin200Response) GetClientIdentifierOk() (*interface{}, bool) {
|
|
if o == nil || isNil(o.ClientIdentifier) {
|
|
return nil, false
|
|
}
|
|
return &o.ClientIdentifier, true
|
|
}
|
|
|
|
// HasClientIdentifier returns a boolean if a field has been set.
|
|
func (o *GetPin200Response) HasClientIdentifier() bool {
|
|
if o != nil && isNil(o.ClientIdentifier) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetClientIdentifier gets a reference to the given interface{} and assigns it to the ClientIdentifier field.
|
|
func (o *GetPin200Response) SetClientIdentifier(v interface{}) {
|
|
o.ClientIdentifier = v
|
|
}
|
|
|
|
// GetLocation returns the Location field value if set, zero value otherwise.
|
|
func (o *GetPin200Response) GetLocation() GetPin200ResponseLocation {
|
|
if o == nil || isNil(o.Location) {
|
|
var ret GetPin200ResponseLocation
|
|
return ret
|
|
}
|
|
return *o.Location
|
|
}
|
|
|
|
// GetLocationOk returns a tuple with the Location field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GetPin200Response) GetLocationOk() (*GetPin200ResponseLocation, bool) {
|
|
if o == nil || isNil(o.Location) {
|
|
return nil, false
|
|
}
|
|
return o.Location, true
|
|
}
|
|
|
|
// HasLocation returns a boolean if a field has been set.
|
|
func (o *GetPin200Response) HasLocation() bool {
|
|
if o != nil && !isNil(o.Location) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLocation gets a reference to the given GetPin200ResponseLocation and assigns it to the Location field.
|
|
func (o *GetPin200Response) SetLocation(v GetPin200ResponseLocation) {
|
|
o.Location = &v
|
|
}
|
|
|
|
// GetExpiresIn returns the ExpiresIn field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *GetPin200Response) GetExpiresIn() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.ExpiresIn
|
|
}
|
|
|
|
// GetExpiresInOk returns a tuple with the ExpiresIn field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *GetPin200Response) GetExpiresInOk() (*interface{}, bool) {
|
|
if o == nil || isNil(o.ExpiresIn) {
|
|
return nil, false
|
|
}
|
|
return &o.ExpiresIn, true
|
|
}
|
|
|
|
// HasExpiresIn returns a boolean if a field has been set.
|
|
func (o *GetPin200Response) HasExpiresIn() bool {
|
|
if o != nil && isNil(o.ExpiresIn) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExpiresIn gets a reference to the given interface{} and assigns it to the ExpiresIn field.
|
|
func (o *GetPin200Response) SetExpiresIn(v interface{}) {
|
|
o.ExpiresIn = v
|
|
}
|
|
|
|
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *GetPin200Response) GetCreatedAt() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.CreatedAt
|
|
}
|
|
|
|
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *GetPin200Response) GetCreatedAtOk() (*interface{}, bool) {
|
|
if o == nil || isNil(o.CreatedAt) {
|
|
return nil, false
|
|
}
|
|
return &o.CreatedAt, true
|
|
}
|
|
|
|
// HasCreatedAt returns a boolean if a field has been set.
|
|
func (o *GetPin200Response) HasCreatedAt() bool {
|
|
if o != nil && isNil(o.CreatedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCreatedAt gets a reference to the given interface{} and assigns it to the CreatedAt field.
|
|
func (o *GetPin200Response) SetCreatedAt(v interface{}) {
|
|
o.CreatedAt = v
|
|
}
|
|
|
|
// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *GetPin200Response) GetExpiresAt() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.ExpiresAt
|
|
}
|
|
|
|
// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *GetPin200Response) GetExpiresAtOk() (*interface{}, bool) {
|
|
if o == nil || isNil(o.ExpiresAt) {
|
|
return nil, false
|
|
}
|
|
return &o.ExpiresAt, true
|
|
}
|
|
|
|
// HasExpiresAt returns a boolean if a field has been set.
|
|
func (o *GetPin200Response) HasExpiresAt() bool {
|
|
if o != nil && isNil(o.ExpiresAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExpiresAt gets a reference to the given interface{} and assigns it to the ExpiresAt field.
|
|
func (o *GetPin200Response) SetExpiresAt(v interface{}) {
|
|
o.ExpiresAt = v
|
|
}
|
|
|
|
// GetAuthToken returns the AuthToken field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *GetPin200Response) GetAuthToken() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.AuthToken
|
|
}
|
|
|
|
// GetAuthTokenOk returns a tuple with the AuthToken field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *GetPin200Response) GetAuthTokenOk() (*interface{}, bool) {
|
|
if o == nil || isNil(o.AuthToken) {
|
|
return nil, false
|
|
}
|
|
return &o.AuthToken, true
|
|
}
|
|
|
|
// HasAuthToken returns a boolean if a field has been set.
|
|
func (o *GetPin200Response) HasAuthToken() bool {
|
|
if o != nil && isNil(o.AuthToken) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAuthToken gets a reference to the given interface{} and assigns it to the AuthToken field.
|
|
func (o *GetPin200Response) SetAuthToken(v interface{}) {
|
|
o.AuthToken = v
|
|
}
|
|
|
|
// GetNewRegistration returns the NewRegistration field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *GetPin200Response) GetNewRegistration() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.NewRegistration
|
|
}
|
|
|
|
// GetNewRegistrationOk returns a tuple with the NewRegistration field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *GetPin200Response) GetNewRegistrationOk() (*interface{}, bool) {
|
|
if o == nil || isNil(o.NewRegistration) {
|
|
return nil, false
|
|
}
|
|
return &o.NewRegistration, true
|
|
}
|
|
|
|
// HasNewRegistration returns a boolean if a field has been set.
|
|
func (o *GetPin200Response) HasNewRegistration() bool {
|
|
if o != nil && isNil(o.NewRegistration) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNewRegistration gets a reference to the given interface{} and assigns it to the NewRegistration field.
|
|
func (o *GetPin200Response) SetNewRegistration(v interface{}) {
|
|
o.NewRegistration = v
|
|
}
|
|
|
|
func (o GetPin200Response) MarshalJSON() ([]byte, error) {
|
|
toSerialize,err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GetPin200Response) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if o.Id != nil {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if o.Code != nil {
|
|
toSerialize["code"] = o.Code
|
|
}
|
|
if o.Product != nil {
|
|
toSerialize["product"] = o.Product
|
|
}
|
|
if o.Trusted != nil {
|
|
toSerialize["trusted"] = o.Trusted
|
|
}
|
|
if o.Qr != nil {
|
|
toSerialize["qr"] = o.Qr
|
|
}
|
|
if o.ClientIdentifier != nil {
|
|
toSerialize["clientIdentifier"] = o.ClientIdentifier
|
|
}
|
|
if !isNil(o.Location) {
|
|
toSerialize["location"] = o.Location
|
|
}
|
|
if o.ExpiresIn != nil {
|
|
toSerialize["expiresIn"] = o.ExpiresIn
|
|
}
|
|
if o.CreatedAt != nil {
|
|
toSerialize["createdAt"] = o.CreatedAt
|
|
}
|
|
if o.ExpiresAt != nil {
|
|
toSerialize["expiresAt"] = o.ExpiresAt
|
|
}
|
|
if o.AuthToken != nil {
|
|
toSerialize["authToken"] = o.AuthToken
|
|
}
|
|
if o.NewRegistration != nil {
|
|
toSerialize["newRegistration"] = o.NewRegistration
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GetPin200Response) UnmarshalJSON(bytes []byte) (err error) {
|
|
varGetPin200Response := _GetPin200Response{}
|
|
|
|
if err = json.Unmarshal(bytes, &varGetPin200Response); err == nil {
|
|
*o = GetPin200Response(varGetPin200Response)
|
|
}
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "code")
|
|
delete(additionalProperties, "product")
|
|
delete(additionalProperties, "trusted")
|
|
delete(additionalProperties, "qr")
|
|
delete(additionalProperties, "clientIdentifier")
|
|
delete(additionalProperties, "location")
|
|
delete(additionalProperties, "expiresIn")
|
|
delete(additionalProperties, "createdAt")
|
|
delete(additionalProperties, "expiresAt")
|
|
delete(additionalProperties, "authToken")
|
|
delete(additionalProperties, "newRegistration")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGetPin200Response struct {
|
|
value *GetPin200Response
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGetPin200Response) Get() *GetPin200Response {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGetPin200Response) Set(val *GetPin200Response) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGetPin200Response) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGetPin200Response) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGetPin200Response(val *GetPin200Response) *NullableGetPin200Response {
|
|
return &NullableGetPin200Response{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGetPin200Response) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGetPin200Response) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|
|
|