/* authentik Making authentication simple. API version: 2026.5.0-rc1 Contact: hello@goauthentik.io */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package api import ( "encoding/json" "fmt" ) // checks if the UserPlexSourceConnectionRequest type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UserPlexSourceConnectionRequest{} // UserPlexSourceConnectionRequest User source connection type UserPlexSourceConnectionRequest struct { User int32 `json:"user"` Source string `json:"source"` Identifier string `json:"identifier"` PlexToken string `json:"plex_token"` AdditionalProperties map[string]interface{} } type _UserPlexSourceConnectionRequest UserPlexSourceConnectionRequest // NewUserPlexSourceConnectionRequest instantiates a new UserPlexSourceConnectionRequest 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 NewUserPlexSourceConnectionRequest(user int32, source string, identifier string, plexToken string) *UserPlexSourceConnectionRequest { this := UserPlexSourceConnectionRequest{} this.User = user this.Source = source this.Identifier = identifier this.PlexToken = plexToken return &this } // NewUserPlexSourceConnectionRequestWithDefaults instantiates a new UserPlexSourceConnectionRequest 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 NewUserPlexSourceConnectionRequestWithDefaults() *UserPlexSourceConnectionRequest { this := UserPlexSourceConnectionRequest{} return &this } // GetUser returns the User field value func (o *UserPlexSourceConnectionRequest) GetUser() int32 { if o == nil { var ret int32 return ret } return o.User } // GetUserOk returns a tuple with the User field value // and a boolean to check if the value has been set. func (o *UserPlexSourceConnectionRequest) GetUserOk() (*int32, bool) { if o == nil { return nil, false } return &o.User, true } // SetUser sets field value func (o *UserPlexSourceConnectionRequest) SetUser(v int32) { o.User = v } // GetSource returns the Source field value func (o *UserPlexSourceConnectionRequest) GetSource() string { if o == nil { var ret string return ret } return o.Source } // GetSourceOk returns a tuple with the Source field value // and a boolean to check if the value has been set. func (o *UserPlexSourceConnectionRequest) GetSourceOk() (*string, bool) { if o == nil { return nil, false } return &o.Source, true } // SetSource sets field value func (o *UserPlexSourceConnectionRequest) SetSource(v string) { o.Source = v } // GetIdentifier returns the Identifier field value func (o *UserPlexSourceConnectionRequest) GetIdentifier() string { if o == nil { var ret string return ret } return o.Identifier } // GetIdentifierOk returns a tuple with the Identifier field value // and a boolean to check if the value has been set. func (o *UserPlexSourceConnectionRequest) GetIdentifierOk() (*string, bool) { if o == nil { return nil, false } return &o.Identifier, true } // SetIdentifier sets field value func (o *UserPlexSourceConnectionRequest) SetIdentifier(v string) { o.Identifier = v } // GetPlexToken returns the PlexToken field value func (o *UserPlexSourceConnectionRequest) GetPlexToken() string { if o == nil { var ret string return ret } return o.PlexToken } // GetPlexTokenOk returns a tuple with the PlexToken field value // and a boolean to check if the value has been set. func (o *UserPlexSourceConnectionRequest) GetPlexTokenOk() (*string, bool) { if o == nil { return nil, false } return &o.PlexToken, true } // SetPlexToken sets field value func (o *UserPlexSourceConnectionRequest) SetPlexToken(v string) { o.PlexToken = v } func (o UserPlexSourceConnectionRequest) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o UserPlexSourceConnectionRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["user"] = o.User toSerialize["source"] = o.Source toSerialize["identifier"] = o.Identifier toSerialize["plex_token"] = o.PlexToken for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *UserPlexSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "user", "source", "identifier", "plex_token", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err } for _, requiredProperty := range requiredProperties { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varUserPlexSourceConnectionRequest := _UserPlexSourceConnectionRequest{} err = json.Unmarshal(data, &varUserPlexSourceConnectionRequest) if err != nil { return err } *o = UserPlexSourceConnectionRequest(varUserPlexSourceConnectionRequest) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "user") delete(additionalProperties, "source") delete(additionalProperties, "identifier") delete(additionalProperties, "plex_token") o.AdditionalProperties = additionalProperties } return err } type NullableUserPlexSourceConnectionRequest struct { value *UserPlexSourceConnectionRequest isSet bool } func (v NullableUserPlexSourceConnectionRequest) Get() *UserPlexSourceConnectionRequest { return v.value } func (v *NullableUserPlexSourceConnectionRequest) Set(val *UserPlexSourceConnectionRequest) { v.value = val v.isSet = true } func (v NullableUserPlexSourceConnectionRequest) IsSet() bool { return v.isSet } func (v *NullableUserPlexSourceConnectionRequest) Unset() { v.value = nil v.isSet = false } func NewNullableUserPlexSourceConnectionRequest(val *UserPlexSourceConnectionRequest) *NullableUserPlexSourceConnectionRequest { return &NullableUserPlexSourceConnectionRequest{value: val, isSet: true} } func (v NullableUserPlexSourceConnectionRequest) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableUserPlexSourceConnectionRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }