Files
authentik/packages/client-go/model_user_o_auth_source_connection.go
T
Marc 'risson' Schmitt 2f70351c90 packages/client-go: init (#21139)
* packages/client-go: init

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>

* format

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* remove mod/sum

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix translate

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* no go replace

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* update rust makefile with pwd

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>

* fix build

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix docs

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* don't need a version ig?

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* exclude go client from cspell

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix main docker build

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
2026-03-25 15:26:50 +01:00

380 lines
9.6 KiB
Go
Generated

/*
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"
"time"
)
// checks if the UserOAuthSourceConnection type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UserOAuthSourceConnection{}
// UserOAuthSourceConnection User source connection
type UserOAuthSourceConnection struct {
Pk int32 `json:"pk"`
User int32 `json:"user"`
Source string `json:"source"`
SourceObj Source `json:"source_obj"`
Identifier string `json:"identifier"`
Created time.Time `json:"created"`
LastUpdated time.Time `json:"last_updated"`
Expires *time.Time `json:"expires,omitempty"`
AdditionalProperties map[string]interface{}
}
type _UserOAuthSourceConnection UserOAuthSourceConnection
// NewUserOAuthSourceConnection instantiates a new UserOAuthSourceConnection 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 NewUserOAuthSourceConnection(pk int32, user int32, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *UserOAuthSourceConnection {
this := UserOAuthSourceConnection{}
this.Pk = pk
this.User = user
this.Source = source
this.SourceObj = sourceObj
this.Identifier = identifier
this.Created = created
this.LastUpdated = lastUpdated
return &this
}
// NewUserOAuthSourceConnectionWithDefaults instantiates a new UserOAuthSourceConnection 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 NewUserOAuthSourceConnectionWithDefaults() *UserOAuthSourceConnection {
this := UserOAuthSourceConnection{}
return &this
}
// GetPk returns the Pk field value
func (o *UserOAuthSourceConnection) GetPk() int32 {
if o == nil {
var ret int32
return ret
}
return o.Pk
}
// GetPkOk returns a tuple with the Pk field value
// and a boolean to check if the value has been set.
func (o *UserOAuthSourceConnection) GetPkOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Pk, true
}
// SetPk sets field value
func (o *UserOAuthSourceConnection) SetPk(v int32) {
o.Pk = v
}
// GetUser returns the User field value
func (o *UserOAuthSourceConnection) 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 *UserOAuthSourceConnection) GetUserOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.User, true
}
// SetUser sets field value
func (o *UserOAuthSourceConnection) SetUser(v int32) {
o.User = v
}
// GetSource returns the Source field value
func (o *UserOAuthSourceConnection) 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 *UserOAuthSourceConnection) GetSourceOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Source, true
}
// SetSource sets field value
func (o *UserOAuthSourceConnection) SetSource(v string) {
o.Source = v
}
// GetSourceObj returns the SourceObj field value
func (o *UserOAuthSourceConnection) GetSourceObj() Source {
if o == nil {
var ret Source
return ret
}
return o.SourceObj
}
// GetSourceObjOk returns a tuple with the SourceObj field value
// and a boolean to check if the value has been set.
func (o *UserOAuthSourceConnection) GetSourceObjOk() (*Source, bool) {
if o == nil {
return nil, false
}
return &o.SourceObj, true
}
// SetSourceObj sets field value
func (o *UserOAuthSourceConnection) SetSourceObj(v Source) {
o.SourceObj = v
}
// GetIdentifier returns the Identifier field value
func (o *UserOAuthSourceConnection) 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 *UserOAuthSourceConnection) GetIdentifierOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Identifier, true
}
// SetIdentifier sets field value
func (o *UserOAuthSourceConnection) SetIdentifier(v string) {
o.Identifier = v
}
// GetCreated returns the Created field value
func (o *UserOAuthSourceConnection) GetCreated() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.Created
}
// GetCreatedOk returns a tuple with the Created field value
// and a boolean to check if the value has been set.
func (o *UserOAuthSourceConnection) GetCreatedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.Created, true
}
// SetCreated sets field value
func (o *UserOAuthSourceConnection) SetCreated(v time.Time) {
o.Created = v
}
// GetLastUpdated returns the LastUpdated field value
func (o *UserOAuthSourceConnection) GetLastUpdated() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.LastUpdated
}
// GetLastUpdatedOk returns a tuple with the LastUpdated field value
// and a boolean to check if the value has been set.
func (o *UserOAuthSourceConnection) GetLastUpdatedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.LastUpdated, true
}
// SetLastUpdated sets field value
func (o *UserOAuthSourceConnection) SetLastUpdated(v time.Time) {
o.LastUpdated = v
}
// GetExpires returns the Expires field value if set, zero value otherwise.
func (o *UserOAuthSourceConnection) GetExpires() time.Time {
if o == nil || IsNil(o.Expires) {
var ret time.Time
return ret
}
return *o.Expires
}
// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserOAuthSourceConnection) GetExpiresOk() (*time.Time, bool) {
if o == nil || IsNil(o.Expires) {
return nil, false
}
return o.Expires, true
}
// HasExpires returns a boolean if a field has been set.
func (o *UserOAuthSourceConnection) HasExpires() bool {
if o != nil && !IsNil(o.Expires) {
return true
}
return false
}
// SetExpires gets a reference to the given time.Time and assigns it to the Expires field.
func (o *UserOAuthSourceConnection) SetExpires(v time.Time) {
o.Expires = &v
}
func (o UserOAuthSourceConnection) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UserOAuthSourceConnection) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["pk"] = o.Pk
toSerialize["user"] = o.User
toSerialize["source"] = o.Source
toSerialize["source_obj"] = o.SourceObj
toSerialize["identifier"] = o.Identifier
toSerialize["created"] = o.Created
toSerialize["last_updated"] = o.LastUpdated
if !IsNil(o.Expires) {
toSerialize["expires"] = o.Expires
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *UserOAuthSourceConnection) 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{
"pk",
"user",
"source",
"source_obj",
"identifier",
"created",
"last_updated",
}
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)
}
}
varUserOAuthSourceConnection := _UserOAuthSourceConnection{}
err = json.Unmarshal(data, &varUserOAuthSourceConnection)
if err != nil {
return err
}
*o = UserOAuthSourceConnection(varUserOAuthSourceConnection)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "pk")
delete(additionalProperties, "user")
delete(additionalProperties, "source")
delete(additionalProperties, "source_obj")
delete(additionalProperties, "identifier")
delete(additionalProperties, "created")
delete(additionalProperties, "last_updated")
delete(additionalProperties, "expires")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableUserOAuthSourceConnection struct {
value *UserOAuthSourceConnection
isSet bool
}
func (v NullableUserOAuthSourceConnection) Get() *UserOAuthSourceConnection {
return v.value
}
func (v *NullableUserOAuthSourceConnection) Set(val *UserOAuthSourceConnection) {
v.value = val
v.isSet = true
}
func (v NullableUserOAuthSourceConnection) IsSet() bool {
return v.isSet
}
func (v *NullableUserOAuthSourceConnection) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUserOAuthSourceConnection(val *UserOAuthSourceConnection) *NullableUserOAuthSourceConnection {
return &NullableUserOAuthSourceConnection{value: val, isSet: true}
}
func (v NullableUserOAuthSourceConnection) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUserOAuthSourceConnection) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}