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>
839 lines
23 KiB
Go
Generated
839 lines
23 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"
|
|
)
|
|
|
|
// checks if the Source type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Source{}
|
|
|
|
// Source Source Serializer
|
|
type Source struct {
|
|
Pk string `json:"pk"`
|
|
// Source's display Name.
|
|
Name string `json:"name"`
|
|
// Internal source name, used in URLs.
|
|
Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"`
|
|
Enabled *bool `json:"enabled,omitempty"`
|
|
// When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon.
|
|
Promoted *bool `json:"promoted,omitempty"`
|
|
// Flow to use when authenticating existing users.
|
|
AuthenticationFlow NullableString `json:"authentication_flow,omitempty"`
|
|
// Flow to use when enrolling new users.
|
|
EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"`
|
|
UserPropertyMappings []string `json:"user_property_mappings,omitempty"`
|
|
GroupPropertyMappings []string `json:"group_property_mappings,omitempty"`
|
|
// Get object component so that we know how to edit the object
|
|
Component string `json:"component"`
|
|
// Return object's verbose_name
|
|
VerboseName string `json:"verbose_name"`
|
|
// Return object's plural verbose_name
|
|
VerboseNamePlural string `json:"verbose_name_plural"`
|
|
// Return internal model name
|
|
MetaModelName string `json:"meta_model_name"`
|
|
PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"`
|
|
// How the source determines if an existing user should be authenticated or a new user enrolled.
|
|
UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"`
|
|
// Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update.
|
|
Managed NullableString `json:"managed"`
|
|
UserPathTemplate *string `json:"user_path_template,omitempty"`
|
|
Icon *string `json:"icon,omitempty"`
|
|
// Get the URL to the source icon
|
|
IconUrl NullableString `json:"icon_url"`
|
|
IconThemedUrls NullableThemedUrls `json:"icon_themed_urls"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _Source Source
|
|
|
|
// NewSource instantiates a new Source 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 NewSource(pk string, name string, slug string, component string, verboseName string, verboseNamePlural string, metaModelName string, managed NullableString, iconUrl NullableString, iconThemedUrls NullableThemedUrls) *Source {
|
|
this := Source{}
|
|
this.Pk = pk
|
|
this.Name = name
|
|
this.Slug = slug
|
|
this.Component = component
|
|
this.VerboseName = verboseName
|
|
this.VerboseNamePlural = verboseNamePlural
|
|
this.MetaModelName = metaModelName
|
|
this.Managed = managed
|
|
this.IconUrl = iconUrl
|
|
this.IconThemedUrls = iconThemedUrls
|
|
return &this
|
|
}
|
|
|
|
// NewSourceWithDefaults instantiates a new Source 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 NewSourceWithDefaults() *Source {
|
|
this := Source{}
|
|
return &this
|
|
}
|
|
|
|
// GetPk returns the Pk field value
|
|
func (o *Source) GetPk() string {
|
|
if o == nil {
|
|
var ret string
|
|
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 *Source) GetPkOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Pk, true
|
|
}
|
|
|
|
// SetPk sets field value
|
|
func (o *Source) SetPk(v string) {
|
|
o.Pk = v
|
|
}
|
|
|
|
// GetName returns the Name field value
|
|
func (o *Source) 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 *Source) GetNameOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Name, true
|
|
}
|
|
|
|
// SetName sets field value
|
|
func (o *Source) SetName(v string) {
|
|
o.Name = v
|
|
}
|
|
|
|
// GetSlug returns the Slug field value
|
|
func (o *Source) GetSlug() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Slug
|
|
}
|
|
|
|
// GetSlugOk returns a tuple with the Slug field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Source) GetSlugOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Slug, true
|
|
}
|
|
|
|
// SetSlug sets field value
|
|
func (o *Source) SetSlug(v string) {
|
|
o.Slug = v
|
|
}
|
|
|
|
// GetEnabled returns the Enabled field value if set, zero value otherwise.
|
|
func (o *Source) GetEnabled() bool {
|
|
if o == nil || IsNil(o.Enabled) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Enabled
|
|
}
|
|
|
|
// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Source) GetEnabledOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Enabled) {
|
|
return nil, false
|
|
}
|
|
return o.Enabled, true
|
|
}
|
|
|
|
// HasEnabled returns a boolean if a field has been set.
|
|
func (o *Source) HasEnabled() bool {
|
|
if o != nil && !IsNil(o.Enabled) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
|
|
func (o *Source) SetEnabled(v bool) {
|
|
o.Enabled = &v
|
|
}
|
|
|
|
// GetPromoted returns the Promoted field value if set, zero value otherwise.
|
|
func (o *Source) GetPromoted() bool {
|
|
if o == nil || IsNil(o.Promoted) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Promoted
|
|
}
|
|
|
|
// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Source) GetPromotedOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Promoted) {
|
|
return nil, false
|
|
}
|
|
return o.Promoted, true
|
|
}
|
|
|
|
// HasPromoted returns a boolean if a field has been set.
|
|
func (o *Source) HasPromoted() bool {
|
|
if o != nil && !IsNil(o.Promoted) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPromoted gets a reference to the given bool and assigns it to the Promoted field.
|
|
func (o *Source) SetPromoted(v bool) {
|
|
o.Promoted = &v
|
|
}
|
|
|
|
// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *Source) GetAuthenticationFlow() string {
|
|
if o == nil || IsNil(o.AuthenticationFlow.Get()) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.AuthenticationFlow.Get()
|
|
}
|
|
|
|
// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow 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 *Source) GetAuthenticationFlowOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet()
|
|
}
|
|
|
|
// HasAuthenticationFlow returns a boolean if a field has been set.
|
|
func (o *Source) HasAuthenticationFlow() bool {
|
|
if o != nil && o.AuthenticationFlow.IsSet() {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field.
|
|
func (o *Source) SetAuthenticationFlow(v string) {
|
|
o.AuthenticationFlow.Set(&v)
|
|
}
|
|
|
|
// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil
|
|
func (o *Source) SetAuthenticationFlowNil() {
|
|
o.AuthenticationFlow.Set(nil)
|
|
}
|
|
|
|
// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil
|
|
func (o *Source) UnsetAuthenticationFlow() {
|
|
o.AuthenticationFlow.Unset()
|
|
}
|
|
|
|
// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *Source) GetEnrollmentFlow() string {
|
|
if o == nil || IsNil(o.EnrollmentFlow.Get()) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.EnrollmentFlow.Get()
|
|
}
|
|
|
|
// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow 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 *Source) GetEnrollmentFlowOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet()
|
|
}
|
|
|
|
// HasEnrollmentFlow returns a boolean if a field has been set.
|
|
func (o *Source) HasEnrollmentFlow() bool {
|
|
if o != nil && o.EnrollmentFlow.IsSet() {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field.
|
|
func (o *Source) SetEnrollmentFlow(v string) {
|
|
o.EnrollmentFlow.Set(&v)
|
|
}
|
|
|
|
// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil
|
|
func (o *Source) SetEnrollmentFlowNil() {
|
|
o.EnrollmentFlow.Set(nil)
|
|
}
|
|
|
|
// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil
|
|
func (o *Source) UnsetEnrollmentFlow() {
|
|
o.EnrollmentFlow.Unset()
|
|
}
|
|
|
|
// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise.
|
|
func (o *Source) GetUserPropertyMappings() []string {
|
|
if o == nil || IsNil(o.UserPropertyMappings) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.UserPropertyMappings
|
|
}
|
|
|
|
// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Source) GetUserPropertyMappingsOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.UserPropertyMappings) {
|
|
return nil, false
|
|
}
|
|
return o.UserPropertyMappings, true
|
|
}
|
|
|
|
// HasUserPropertyMappings returns a boolean if a field has been set.
|
|
func (o *Source) HasUserPropertyMappings() bool {
|
|
if o != nil && !IsNil(o.UserPropertyMappings) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field.
|
|
func (o *Source) SetUserPropertyMappings(v []string) {
|
|
o.UserPropertyMappings = v
|
|
}
|
|
|
|
// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise.
|
|
func (o *Source) GetGroupPropertyMappings() []string {
|
|
if o == nil || IsNil(o.GroupPropertyMappings) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.GroupPropertyMappings
|
|
}
|
|
|
|
// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Source) GetGroupPropertyMappingsOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.GroupPropertyMappings) {
|
|
return nil, false
|
|
}
|
|
return o.GroupPropertyMappings, true
|
|
}
|
|
|
|
// HasGroupPropertyMappings returns a boolean if a field has been set.
|
|
func (o *Source) HasGroupPropertyMappings() bool {
|
|
if o != nil && !IsNil(o.GroupPropertyMappings) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field.
|
|
func (o *Source) SetGroupPropertyMappings(v []string) {
|
|
o.GroupPropertyMappings = v
|
|
}
|
|
|
|
// GetComponent returns the Component field value
|
|
func (o *Source) GetComponent() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Component
|
|
}
|
|
|
|
// GetComponentOk returns a tuple with the Component field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Source) GetComponentOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Component, true
|
|
}
|
|
|
|
// SetComponent sets field value
|
|
func (o *Source) SetComponent(v string) {
|
|
o.Component = v
|
|
}
|
|
|
|
// GetVerboseName returns the VerboseName field value
|
|
func (o *Source) GetVerboseName() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.VerboseName
|
|
}
|
|
|
|
// GetVerboseNameOk returns a tuple with the VerboseName field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Source) GetVerboseNameOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.VerboseName, true
|
|
}
|
|
|
|
// SetVerboseName sets field value
|
|
func (o *Source) SetVerboseName(v string) {
|
|
o.VerboseName = v
|
|
}
|
|
|
|
// GetVerboseNamePlural returns the VerboseNamePlural field value
|
|
func (o *Source) GetVerboseNamePlural() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.VerboseNamePlural
|
|
}
|
|
|
|
// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Source) GetVerboseNamePluralOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.VerboseNamePlural, true
|
|
}
|
|
|
|
// SetVerboseNamePlural sets field value
|
|
func (o *Source) SetVerboseNamePlural(v string) {
|
|
o.VerboseNamePlural = v
|
|
}
|
|
|
|
// GetMetaModelName returns the MetaModelName field value
|
|
func (o *Source) GetMetaModelName() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.MetaModelName
|
|
}
|
|
|
|
// GetMetaModelNameOk returns a tuple with the MetaModelName field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Source) GetMetaModelNameOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.MetaModelName, true
|
|
}
|
|
|
|
// SetMetaModelName sets field value
|
|
func (o *Source) SetMetaModelName(v string) {
|
|
o.MetaModelName = v
|
|
}
|
|
|
|
// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise.
|
|
func (o *Source) GetPolicyEngineMode() PolicyEngineMode {
|
|
if o == nil || IsNil(o.PolicyEngineMode) {
|
|
var ret PolicyEngineMode
|
|
return ret
|
|
}
|
|
return *o.PolicyEngineMode
|
|
}
|
|
|
|
// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Source) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) {
|
|
if o == nil || IsNil(o.PolicyEngineMode) {
|
|
return nil, false
|
|
}
|
|
return o.PolicyEngineMode, true
|
|
}
|
|
|
|
// HasPolicyEngineMode returns a boolean if a field has been set.
|
|
func (o *Source) HasPolicyEngineMode() bool {
|
|
if o != nil && !IsNil(o.PolicyEngineMode) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field.
|
|
func (o *Source) SetPolicyEngineMode(v PolicyEngineMode) {
|
|
o.PolicyEngineMode = &v
|
|
}
|
|
|
|
// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise.
|
|
func (o *Source) GetUserMatchingMode() UserMatchingModeEnum {
|
|
if o == nil || IsNil(o.UserMatchingMode) {
|
|
var ret UserMatchingModeEnum
|
|
return ret
|
|
}
|
|
return *o.UserMatchingMode
|
|
}
|
|
|
|
// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Source) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) {
|
|
if o == nil || IsNil(o.UserMatchingMode) {
|
|
return nil, false
|
|
}
|
|
return o.UserMatchingMode, true
|
|
}
|
|
|
|
// HasUserMatchingMode returns a boolean if a field has been set.
|
|
func (o *Source) HasUserMatchingMode() bool {
|
|
if o != nil && !IsNil(o.UserMatchingMode) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field.
|
|
func (o *Source) SetUserMatchingMode(v UserMatchingModeEnum) {
|
|
o.UserMatchingMode = &v
|
|
}
|
|
|
|
// GetManaged returns the Managed field value
|
|
// If the value is explicit nil, the zero value for string will be returned
|
|
func (o *Source) GetManaged() string {
|
|
if o == nil || o.Managed.Get() == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return *o.Managed.Get()
|
|
}
|
|
|
|
// GetManagedOk returns a tuple with the Managed field value
|
|
// 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 *Source) GetManagedOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.Managed.Get(), o.Managed.IsSet()
|
|
}
|
|
|
|
// SetManaged sets field value
|
|
func (o *Source) SetManaged(v string) {
|
|
o.Managed.Set(&v)
|
|
}
|
|
|
|
// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise.
|
|
func (o *Source) GetUserPathTemplate() string {
|
|
if o == nil || IsNil(o.UserPathTemplate) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.UserPathTemplate
|
|
}
|
|
|
|
// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Source) GetUserPathTemplateOk() (*string, bool) {
|
|
if o == nil || IsNil(o.UserPathTemplate) {
|
|
return nil, false
|
|
}
|
|
return o.UserPathTemplate, true
|
|
}
|
|
|
|
// HasUserPathTemplate returns a boolean if a field has been set.
|
|
func (o *Source) HasUserPathTemplate() bool {
|
|
if o != nil && !IsNil(o.UserPathTemplate) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field.
|
|
func (o *Source) SetUserPathTemplate(v string) {
|
|
o.UserPathTemplate = &v
|
|
}
|
|
|
|
// GetIcon returns the Icon field value if set, zero value otherwise.
|
|
func (o *Source) GetIcon() string {
|
|
if o == nil || IsNil(o.Icon) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Icon
|
|
}
|
|
|
|
// GetIconOk returns a tuple with the Icon field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Source) GetIconOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Icon) {
|
|
return nil, false
|
|
}
|
|
return o.Icon, true
|
|
}
|
|
|
|
// HasIcon returns a boolean if a field has been set.
|
|
func (o *Source) HasIcon() bool {
|
|
if o != nil && !IsNil(o.Icon) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetIcon gets a reference to the given string and assigns it to the Icon field.
|
|
func (o *Source) SetIcon(v string) {
|
|
o.Icon = &v
|
|
}
|
|
|
|
// GetIconUrl returns the IconUrl field value
|
|
// If the value is explicit nil, the zero value for string will be returned
|
|
func (o *Source) GetIconUrl() string {
|
|
if o == nil || o.IconUrl.Get() == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return *o.IconUrl.Get()
|
|
}
|
|
|
|
// GetIconUrlOk returns a tuple with the IconUrl field value
|
|
// 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 *Source) GetIconUrlOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.IconUrl.Get(), o.IconUrl.IsSet()
|
|
}
|
|
|
|
// SetIconUrl sets field value
|
|
func (o *Source) SetIconUrl(v string) {
|
|
o.IconUrl.Set(&v)
|
|
}
|
|
|
|
// GetIconThemedUrls returns the IconThemedUrls field value
|
|
// If the value is explicit nil, the zero value for ThemedUrls will be returned
|
|
func (o *Source) GetIconThemedUrls() ThemedUrls {
|
|
if o == nil || o.IconThemedUrls.Get() == nil {
|
|
var ret ThemedUrls
|
|
return ret
|
|
}
|
|
|
|
return *o.IconThemedUrls.Get()
|
|
}
|
|
|
|
// GetIconThemedUrlsOk returns a tuple with the IconThemedUrls field value
|
|
// 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 *Source) GetIconThemedUrlsOk() (*ThemedUrls, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.IconThemedUrls.Get(), o.IconThemedUrls.IsSet()
|
|
}
|
|
|
|
// SetIconThemedUrls sets field value
|
|
func (o *Source) SetIconThemedUrls(v ThemedUrls) {
|
|
o.IconThemedUrls.Set(&v)
|
|
}
|
|
|
|
func (o Source) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o Source) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["pk"] = o.Pk
|
|
toSerialize["name"] = o.Name
|
|
toSerialize["slug"] = o.Slug
|
|
if !IsNil(o.Enabled) {
|
|
toSerialize["enabled"] = o.Enabled
|
|
}
|
|
if !IsNil(o.Promoted) {
|
|
toSerialize["promoted"] = o.Promoted
|
|
}
|
|
if o.AuthenticationFlow.IsSet() {
|
|
toSerialize["authentication_flow"] = o.AuthenticationFlow.Get()
|
|
}
|
|
if o.EnrollmentFlow.IsSet() {
|
|
toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get()
|
|
}
|
|
if !IsNil(o.UserPropertyMappings) {
|
|
toSerialize["user_property_mappings"] = o.UserPropertyMappings
|
|
}
|
|
if !IsNil(o.GroupPropertyMappings) {
|
|
toSerialize["group_property_mappings"] = o.GroupPropertyMappings
|
|
}
|
|
toSerialize["component"] = o.Component
|
|
toSerialize["verbose_name"] = o.VerboseName
|
|
toSerialize["verbose_name_plural"] = o.VerboseNamePlural
|
|
toSerialize["meta_model_name"] = o.MetaModelName
|
|
if !IsNil(o.PolicyEngineMode) {
|
|
toSerialize["policy_engine_mode"] = o.PolicyEngineMode
|
|
}
|
|
if !IsNil(o.UserMatchingMode) {
|
|
toSerialize["user_matching_mode"] = o.UserMatchingMode
|
|
}
|
|
toSerialize["managed"] = o.Managed.Get()
|
|
if !IsNil(o.UserPathTemplate) {
|
|
toSerialize["user_path_template"] = o.UserPathTemplate
|
|
}
|
|
if !IsNil(o.Icon) {
|
|
toSerialize["icon"] = o.Icon
|
|
}
|
|
toSerialize["icon_url"] = o.IconUrl.Get()
|
|
toSerialize["icon_themed_urls"] = o.IconThemedUrls.Get()
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *Source) 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",
|
|
"name",
|
|
"slug",
|
|
"component",
|
|
"verbose_name",
|
|
"verbose_name_plural",
|
|
"meta_model_name",
|
|
"managed",
|
|
"icon_url",
|
|
"icon_themed_urls",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varSource := _Source{}
|
|
|
|
err = json.Unmarshal(data, &varSource)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = Source(varSource)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "pk")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "slug")
|
|
delete(additionalProperties, "enabled")
|
|
delete(additionalProperties, "promoted")
|
|
delete(additionalProperties, "authentication_flow")
|
|
delete(additionalProperties, "enrollment_flow")
|
|
delete(additionalProperties, "user_property_mappings")
|
|
delete(additionalProperties, "group_property_mappings")
|
|
delete(additionalProperties, "component")
|
|
delete(additionalProperties, "verbose_name")
|
|
delete(additionalProperties, "verbose_name_plural")
|
|
delete(additionalProperties, "meta_model_name")
|
|
delete(additionalProperties, "policy_engine_mode")
|
|
delete(additionalProperties, "user_matching_mode")
|
|
delete(additionalProperties, "managed")
|
|
delete(additionalProperties, "user_path_template")
|
|
delete(additionalProperties, "icon")
|
|
delete(additionalProperties, "icon_url")
|
|
delete(additionalProperties, "icon_themed_urls")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableSource struct {
|
|
value *Source
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableSource) Get() *Source {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableSource) Set(val *Source) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableSource) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableSource) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableSource(val *Source) *NullableSource {
|
|
return &NullableSource{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableSource) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableSource) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|