mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-18 03:19:51 +03:00
2f70351c90
* 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>
507 lines
13 KiB
Go
Generated
507 lines
13 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 UserRequest type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &UserRequest{}
|
|
|
|
// UserRequest User Serializer
|
|
type UserRequest struct {
|
|
Username string `json:"username"`
|
|
// User's display name.
|
|
Name string `json:"name"`
|
|
// Designates whether this user should be treated as active. Unselect this instead of deleting accounts.
|
|
IsActive *bool `json:"is_active,omitempty"`
|
|
LastLogin NullableTime `json:"last_login,omitempty"`
|
|
Groups []string `json:"groups,omitempty"`
|
|
Roles []string `json:"roles,omitempty"`
|
|
Email *string `json:"email,omitempty"`
|
|
Attributes map[string]interface{} `json:"attributes,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
Type *UserTypeEnum `json:"type,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _UserRequest UserRequest
|
|
|
|
// NewUserRequest instantiates a new UserRequest 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 NewUserRequest(username string, name string) *UserRequest {
|
|
this := UserRequest{}
|
|
this.Username = username
|
|
this.Name = name
|
|
return &this
|
|
}
|
|
|
|
// NewUserRequestWithDefaults instantiates a new UserRequest 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 NewUserRequestWithDefaults() *UserRequest {
|
|
this := UserRequest{}
|
|
return &this
|
|
}
|
|
|
|
// GetUsername returns the Username field value
|
|
func (o *UserRequest) GetUsername() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Username
|
|
}
|
|
|
|
// GetUsernameOk returns a tuple with the Username field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UserRequest) GetUsernameOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Username, true
|
|
}
|
|
|
|
// SetUsername sets field value
|
|
func (o *UserRequest) SetUsername(v string) {
|
|
o.Username = v
|
|
}
|
|
|
|
// GetName returns the Name field value
|
|
func (o *UserRequest) GetName() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UserRequest) GetNameOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Name, true
|
|
}
|
|
|
|
// SetName sets field value
|
|
func (o *UserRequest) SetName(v string) {
|
|
o.Name = v
|
|
}
|
|
|
|
// GetIsActive returns the IsActive field value if set, zero value otherwise.
|
|
func (o *UserRequest) GetIsActive() bool {
|
|
if o == nil || IsNil(o.IsActive) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.IsActive
|
|
}
|
|
|
|
// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UserRequest) GetIsActiveOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.IsActive) {
|
|
return nil, false
|
|
}
|
|
return o.IsActive, true
|
|
}
|
|
|
|
// HasIsActive returns a boolean if a field has been set.
|
|
func (o *UserRequest) HasIsActive() bool {
|
|
if o != nil && !IsNil(o.IsActive) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetIsActive gets a reference to the given bool and assigns it to the IsActive field.
|
|
func (o *UserRequest) SetIsActive(v bool) {
|
|
o.IsActive = &v
|
|
}
|
|
|
|
// GetLastLogin returns the LastLogin field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *UserRequest) GetLastLogin() time.Time {
|
|
if o == nil || IsNil(o.LastLogin.Get()) {
|
|
var ret time.Time
|
|
return ret
|
|
}
|
|
return *o.LastLogin.Get()
|
|
}
|
|
|
|
// GetLastLoginOk returns a tuple with the LastLogin 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 *UserRequest) GetLastLoginOk() (*time.Time, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.LastLogin.Get(), o.LastLogin.IsSet()
|
|
}
|
|
|
|
// HasLastLogin returns a boolean if a field has been set.
|
|
func (o *UserRequest) HasLastLogin() bool {
|
|
if o != nil && o.LastLogin.IsSet() {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLastLogin gets a reference to the given NullableTime and assigns it to the LastLogin field.
|
|
func (o *UserRequest) SetLastLogin(v time.Time) {
|
|
o.LastLogin.Set(&v)
|
|
}
|
|
|
|
// SetLastLoginNil sets the value for LastLogin to be an explicit nil
|
|
func (o *UserRequest) SetLastLoginNil() {
|
|
o.LastLogin.Set(nil)
|
|
}
|
|
|
|
// UnsetLastLogin ensures that no value is present for LastLogin, not even an explicit nil
|
|
func (o *UserRequest) UnsetLastLogin() {
|
|
o.LastLogin.Unset()
|
|
}
|
|
|
|
// GetGroups returns the Groups field value if set, zero value otherwise.
|
|
func (o *UserRequest) GetGroups() []string {
|
|
if o == nil || IsNil(o.Groups) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Groups
|
|
}
|
|
|
|
// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UserRequest) GetGroupsOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Groups) {
|
|
return nil, false
|
|
}
|
|
return o.Groups, true
|
|
}
|
|
|
|
// HasGroups returns a boolean if a field has been set.
|
|
func (o *UserRequest) HasGroups() bool {
|
|
if o != nil && !IsNil(o.Groups) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetGroups gets a reference to the given []string and assigns it to the Groups field.
|
|
func (o *UserRequest) SetGroups(v []string) {
|
|
o.Groups = v
|
|
}
|
|
|
|
// GetRoles returns the Roles field value if set, zero value otherwise.
|
|
func (o *UserRequest) GetRoles() []string {
|
|
if o == nil || IsNil(o.Roles) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Roles
|
|
}
|
|
|
|
// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UserRequest) GetRolesOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Roles) {
|
|
return nil, false
|
|
}
|
|
return o.Roles, true
|
|
}
|
|
|
|
// HasRoles returns a boolean if a field has been set.
|
|
func (o *UserRequest) HasRoles() bool {
|
|
if o != nil && !IsNil(o.Roles) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRoles gets a reference to the given []string and assigns it to the Roles field.
|
|
func (o *UserRequest) SetRoles(v []string) {
|
|
o.Roles = v
|
|
}
|
|
|
|
// GetEmail returns the Email field value if set, zero value otherwise.
|
|
func (o *UserRequest) GetEmail() string {
|
|
if o == nil || IsNil(o.Email) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Email
|
|
}
|
|
|
|
// GetEmailOk returns a tuple with the Email field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UserRequest) GetEmailOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Email) {
|
|
return nil, false
|
|
}
|
|
return o.Email, true
|
|
}
|
|
|
|
// HasEmail returns a boolean if a field has been set.
|
|
func (o *UserRequest) HasEmail() bool {
|
|
if o != nil && !IsNil(o.Email) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEmail gets a reference to the given string and assigns it to the Email field.
|
|
func (o *UserRequest) SetEmail(v string) {
|
|
o.Email = &v
|
|
}
|
|
|
|
// GetAttributes returns the Attributes field value if set, zero value otherwise.
|
|
func (o *UserRequest) GetAttributes() map[string]interface{} {
|
|
if o == nil || IsNil(o.Attributes) {
|
|
var ret map[string]interface{}
|
|
return ret
|
|
}
|
|
return o.Attributes
|
|
}
|
|
|
|
// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UserRequest) GetAttributesOk() (map[string]interface{}, bool) {
|
|
if o == nil || IsNil(o.Attributes) {
|
|
return map[string]interface{}{}, false
|
|
}
|
|
return o.Attributes, true
|
|
}
|
|
|
|
// HasAttributes returns a boolean if a field has been set.
|
|
func (o *UserRequest) HasAttributes() bool {
|
|
if o != nil && !IsNil(o.Attributes) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field.
|
|
func (o *UserRequest) SetAttributes(v map[string]interface{}) {
|
|
o.Attributes = v
|
|
}
|
|
|
|
// GetPath returns the Path field value if set, zero value otherwise.
|
|
func (o *UserRequest) GetPath() string {
|
|
if o == nil || IsNil(o.Path) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Path
|
|
}
|
|
|
|
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UserRequest) GetPathOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Path) {
|
|
return nil, false
|
|
}
|
|
return o.Path, true
|
|
}
|
|
|
|
// HasPath returns a boolean if a field has been set.
|
|
func (o *UserRequest) HasPath() bool {
|
|
if o != nil && !IsNil(o.Path) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPath gets a reference to the given string and assigns it to the Path field.
|
|
func (o *UserRequest) SetPath(v string) {
|
|
o.Path = &v
|
|
}
|
|
|
|
// GetType returns the Type field value if set, zero value otherwise.
|
|
func (o *UserRequest) GetType() UserTypeEnum {
|
|
if o == nil || IsNil(o.Type) {
|
|
var ret UserTypeEnum
|
|
return ret
|
|
}
|
|
return *o.Type
|
|
}
|
|
|
|
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UserRequest) GetTypeOk() (*UserTypeEnum, bool) {
|
|
if o == nil || IsNil(o.Type) {
|
|
return nil, false
|
|
}
|
|
return o.Type, true
|
|
}
|
|
|
|
// HasType returns a boolean if a field has been set.
|
|
func (o *UserRequest) HasType() bool {
|
|
if o != nil && !IsNil(o.Type) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetType gets a reference to the given UserTypeEnum and assigns it to the Type field.
|
|
func (o *UserRequest) SetType(v UserTypeEnum) {
|
|
o.Type = &v
|
|
}
|
|
|
|
func (o UserRequest) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o UserRequest) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["username"] = o.Username
|
|
toSerialize["name"] = o.Name
|
|
if !IsNil(o.IsActive) {
|
|
toSerialize["is_active"] = o.IsActive
|
|
}
|
|
if o.LastLogin.IsSet() {
|
|
toSerialize["last_login"] = o.LastLogin.Get()
|
|
}
|
|
if !IsNil(o.Groups) {
|
|
toSerialize["groups"] = o.Groups
|
|
}
|
|
if !IsNil(o.Roles) {
|
|
toSerialize["roles"] = o.Roles
|
|
}
|
|
if !IsNil(o.Email) {
|
|
toSerialize["email"] = o.Email
|
|
}
|
|
if !IsNil(o.Attributes) {
|
|
toSerialize["attributes"] = o.Attributes
|
|
}
|
|
if !IsNil(o.Path) {
|
|
toSerialize["path"] = o.Path
|
|
}
|
|
if !IsNil(o.Type) {
|
|
toSerialize["type"] = o.Type
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *UserRequest) 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{
|
|
"username",
|
|
"name",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varUserRequest := _UserRequest{}
|
|
|
|
err = json.Unmarshal(data, &varUserRequest)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = UserRequest(varUserRequest)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "username")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "is_active")
|
|
delete(additionalProperties, "last_login")
|
|
delete(additionalProperties, "groups")
|
|
delete(additionalProperties, "roles")
|
|
delete(additionalProperties, "email")
|
|
delete(additionalProperties, "attributes")
|
|
delete(additionalProperties, "path")
|
|
delete(additionalProperties, "type")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableUserRequest struct {
|
|
value *UserRequest
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableUserRequest) Get() *UserRequest {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableUserRequest) Set(val *UserRequest) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableUserRequest) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableUserRequest) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableUserRequest(val *UserRequest) *NullableUserRequest {
|
|
return &NullableUserRequest{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableUserRequest) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableUserRequest) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|