mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-17 19:09:11 +03:00
57d2135c8a
* init user Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix and update groups Signed-off-by: Jens Langhammer <jens@goauthentik.io> * split api Signed-off-by: Jens Langhammer <jens@goauthentik.io> * include user and group in ldap conn Signed-off-by: Jens Langhammer <jens@goauthentik.io> * unrelated cleanup Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add ldap users/groups page Signed-off-by: Jens Langhammer <jens@goauthentik.io> * ui cleanup Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fixup Signed-off-by: Jens Langhammer <jens@goauthentik.io> * update error message Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix import Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add forms for user/group connections Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix py sync Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fixup web Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix connection not always saved Signed-off-by: Jens Langhammer <jens@goauthentik.io> * more tests Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix help text Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io>
372 lines
9.3 KiB
Go
Generated
372 lines
9.3 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 UserLDAPSourceConnection type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &UserLDAPSourceConnection{}
|
|
|
|
// UserLDAPSourceConnection User source connection
|
|
type UserLDAPSourceConnection 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"`
|
|
UserObj PartialUser `json:"user_obj"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _UserLDAPSourceConnection UserLDAPSourceConnection
|
|
|
|
// NewUserLDAPSourceConnection instantiates a new UserLDAPSourceConnection 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 NewUserLDAPSourceConnection(pk int32, user int32, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time, userObj PartialUser) *UserLDAPSourceConnection {
|
|
this := UserLDAPSourceConnection{}
|
|
this.Pk = pk
|
|
this.User = user
|
|
this.Source = source
|
|
this.SourceObj = sourceObj
|
|
this.Identifier = identifier
|
|
this.Created = created
|
|
this.LastUpdated = lastUpdated
|
|
this.UserObj = userObj
|
|
return &this
|
|
}
|
|
|
|
// NewUserLDAPSourceConnectionWithDefaults instantiates a new UserLDAPSourceConnection 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 NewUserLDAPSourceConnectionWithDefaults() *UserLDAPSourceConnection {
|
|
this := UserLDAPSourceConnection{}
|
|
return &this
|
|
}
|
|
|
|
// GetPk returns the Pk field value
|
|
func (o *UserLDAPSourceConnection) 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 *UserLDAPSourceConnection) GetPkOk() (*int32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Pk, true
|
|
}
|
|
|
|
// SetPk sets field value
|
|
func (o *UserLDAPSourceConnection) SetPk(v int32) {
|
|
o.Pk = v
|
|
}
|
|
|
|
// GetUser returns the User field value
|
|
func (o *UserLDAPSourceConnection) 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 *UserLDAPSourceConnection) GetUserOk() (*int32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.User, true
|
|
}
|
|
|
|
// SetUser sets field value
|
|
func (o *UserLDAPSourceConnection) SetUser(v int32) {
|
|
o.User = v
|
|
}
|
|
|
|
// GetSource returns the Source field value
|
|
func (o *UserLDAPSourceConnection) 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 *UserLDAPSourceConnection) GetSourceOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Source, true
|
|
}
|
|
|
|
// SetSource sets field value
|
|
func (o *UserLDAPSourceConnection) SetSource(v string) {
|
|
o.Source = v
|
|
}
|
|
|
|
// GetSourceObj returns the SourceObj field value
|
|
func (o *UserLDAPSourceConnection) 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 *UserLDAPSourceConnection) GetSourceObjOk() (*Source, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.SourceObj, true
|
|
}
|
|
|
|
// SetSourceObj sets field value
|
|
func (o *UserLDAPSourceConnection) SetSourceObj(v Source) {
|
|
o.SourceObj = v
|
|
}
|
|
|
|
// GetIdentifier returns the Identifier field value
|
|
func (o *UserLDAPSourceConnection) 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 *UserLDAPSourceConnection) GetIdentifierOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Identifier, true
|
|
}
|
|
|
|
// SetIdentifier sets field value
|
|
func (o *UserLDAPSourceConnection) SetIdentifier(v string) {
|
|
o.Identifier = v
|
|
}
|
|
|
|
// GetCreated returns the Created field value
|
|
func (o *UserLDAPSourceConnection) 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 *UserLDAPSourceConnection) GetCreatedOk() (*time.Time, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Created, true
|
|
}
|
|
|
|
// SetCreated sets field value
|
|
func (o *UserLDAPSourceConnection) SetCreated(v time.Time) {
|
|
o.Created = v
|
|
}
|
|
|
|
// GetLastUpdated returns the LastUpdated field value
|
|
func (o *UserLDAPSourceConnection) 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 *UserLDAPSourceConnection) GetLastUpdatedOk() (*time.Time, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.LastUpdated, true
|
|
}
|
|
|
|
// SetLastUpdated sets field value
|
|
func (o *UserLDAPSourceConnection) SetLastUpdated(v time.Time) {
|
|
o.LastUpdated = v
|
|
}
|
|
|
|
// GetUserObj returns the UserObj field value
|
|
func (o *UserLDAPSourceConnection) GetUserObj() PartialUser {
|
|
if o == nil {
|
|
var ret PartialUser
|
|
return ret
|
|
}
|
|
|
|
return o.UserObj
|
|
}
|
|
|
|
// GetUserObjOk returns a tuple with the UserObj field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UserLDAPSourceConnection) GetUserObjOk() (*PartialUser, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.UserObj, true
|
|
}
|
|
|
|
// SetUserObj sets field value
|
|
func (o *UserLDAPSourceConnection) SetUserObj(v PartialUser) {
|
|
o.UserObj = v
|
|
}
|
|
|
|
func (o UserLDAPSourceConnection) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o UserLDAPSourceConnection) 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
|
|
toSerialize["user_obj"] = o.UserObj
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *UserLDAPSourceConnection) 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",
|
|
"user_obj",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varUserLDAPSourceConnection := _UserLDAPSourceConnection{}
|
|
|
|
err = json.Unmarshal(data, &varUserLDAPSourceConnection)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = UserLDAPSourceConnection(varUserLDAPSourceConnection)
|
|
|
|
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, "user_obj")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableUserLDAPSourceConnection struct {
|
|
value *UserLDAPSourceConnection
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableUserLDAPSourceConnection) Get() *UserLDAPSourceConnection {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableUserLDAPSourceConnection) Set(val *UserLDAPSourceConnection) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableUserLDAPSourceConnection) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableUserLDAPSourceConnection) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableUserLDAPSourceConnection(val *UserLDAPSourceConnection) *NullableUserLDAPSourceConnection {
|
|
return &NullableUserLDAPSourceConnection{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableUserLDAPSourceConnection) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableUserLDAPSourceConnection) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|