Class: Zitadel::Client::Models::SettingsServiceLoginSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/zitadel/client/models/settings_service_login_settings.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SettingsServiceLoginSettings

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Models attributes in the form of hash



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 166

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    # MODIFIED: Updated class name in error message
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceLoginSettings` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      # MODIFIED: Updated class name in error message
      fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceLoginSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'allow_username_password')
    self.allow_username_password = attributes[:'allow_username_password']
  end

  if attributes.key?(:'allow_register')
    self.allow_register = attributes[:'allow_register']
  end

  if attributes.key?(:'allow_external_idp')
    self.allow_external_idp = attributes[:'allow_external_idp']
  end

  if attributes.key?(:'force_mfa')
    self.force_mfa = attributes[:'force_mfa']
  end

  if attributes.key?(:'passkeys_type')
    self.passkeys_type = attributes[:'passkeys_type']
  else
    self.passkeys_type = 'PASSKEYS_TYPE_NOT_ALLOWED'
  end

  if attributes.key?(:'hide_password_reset')
    self.hide_password_reset = attributes[:'hide_password_reset']
  end

  if attributes.key?(:'ignore_unknown_usernames')
    self.ignore_unknown_usernames = attributes[:'ignore_unknown_usernames']
  end

  if attributes.key?(:'default_redirect_uri')
    self.default_redirect_uri = attributes[:'default_redirect_uri']
  end

  if attributes.key?(:'password_check_lifetime')
    self.password_check_lifetime = attributes[:'password_check_lifetime']
  end

  if attributes.key?(:'external_login_check_lifetime')
    self. = attributes[:'external_login_check_lifetime']
  end

  if attributes.key?(:'mfa_init_skip_lifetime')
    self.mfa_init_skip_lifetime = attributes[:'mfa_init_skip_lifetime']
  end

  if attributes.key?(:'second_factor_check_lifetime')
    self.second_factor_check_lifetime = attributes[:'second_factor_check_lifetime']
  end

  if attributes.key?(:'multi_factor_check_lifetime')
    self.multi_factor_check_lifetime = attributes[:'multi_factor_check_lifetime']
  end

  if attributes.key?(:'second_factors')
    if (value = attributes[:'second_factors']).is_a?(Array)
      self.second_factors = value
    end
  end

  if attributes.key?(:'multi_factors')
    if (value = attributes[:'multi_factors']).is_a?(Array)
      self.multi_factors = value
    end
  end

  if attributes.key?(:'allow_domain_discovery')
    self.allow_domain_discovery = attributes[:'allow_domain_discovery']
  end

  if attributes.key?(:'disable_login_with_email')
    self. = attributes[:'disable_login_with_email']
  end

  if attributes.key?(:'disable_login_with_phone')
    self. = attributes[:'disable_login_with_phone']
  end

  if attributes.key?(:'resource_owner_type')
    self.resource_owner_type = attributes[:'resource_owner_type']
  else
    self.resource_owner_type = 'RESOURCE_OWNER_TYPE_UNSPECIFIED'
  end

  if attributes.key?(:'force_mfa_local_only')
    self.force_mfa_local_only = attributes[:'force_mfa_local_only']
  end
end

Instance Attribute Details

#allow_domain_discoveryObject

If set to true, the suffix (@domain.com) of an unknown username input on the login screen will be matched against the org domains and will redirect to the registration of that organization on success.



61
62
63
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 61

def allow_domain_discovery
  @allow_domain_discovery
end

#allow_external_idpObject

defines if a user is allowed to add a defined identity provider. E.g. Google auth



25
26
27
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 25

def allow_external_idp
  @allow_external_idp
end

#allow_registerObject

defines if a person is allowed to register a user on this organization



22
23
24
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 22

def allow_register
  @allow_register
end

#allow_username_passwordObject

defines if a user is allowed to log in with username and password



19
20
21
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 19

def allow_username_password
  @allow_username_password
end

#default_redirect_uriObject

defines where the user will be redirected to if the login is started without app context (e.g. from mail)



39
40
41
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 39

def default_redirect_uri
  @default_redirect_uri
end

#disable_login_with_emailObject

defines if the user can additionally (to the login name) be identified by their verified email address



64
65
66
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 64

def 
  @disable_login_with_email
end

#disable_login_with_phoneObject

defines if the user can additionally (to the login name) be identified by their verified phone number



67
68
69
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 67

def 
  @disable_login_with_phone
end

#external_login_check_lifetimeObject

Defines after how much time the user has to re-authenticate with an external provider.



45
46
47
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 45

def 
  @external_login_check_lifetime
end

#force_mfaObject

defines if a user MUST use a multi-factor to log in



28
29
30
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 28

def force_mfa
  @force_mfa
end

#force_mfa_local_onlyObject

if activated, only local authenticated users are forced to use MFA. Authentication through IDPs won’t prompt a MFA step in the login.



72
73
74
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 72

def force_mfa_local_only
  @force_mfa_local_only
end

#hide_password_resetObject

defines if password reset link should be shown in the login screen



33
34
35
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 33

def hide_password_reset
  @hide_password_reset
end

#ignore_unknown_usernamesObject

defines if unknown username on login screen directly returns an error or always displays the password screen



36
37
38
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 36

def ignore_unknown_usernames
  @ignore_unknown_usernames
end

#mfa_init_skip_lifetimeObject

Defines after how much time the mfa prompt will be shown again.



48
49
50
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 48

def mfa_init_skip_lifetime
  @mfa_init_skip_lifetime
end

#multi_factor_check_lifetimeObject

Defines how long the multi-factor check is valid.



54
55
56
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 54

def multi_factor_check_lifetime
  @multi_factor_check_lifetime
end

#multi_factorsObject

Returns the value of attribute multi_factors.



58
59
60
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 58

def multi_factors
  @multi_factors
end

#passkeys_typeObject

Returns the value of attribute passkeys_type.



30
31
32
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 30

def passkeys_type
  @passkeys_type
end

#password_check_lifetimeObject

Defines after how much time the user has to re-authenticate with the password.



42
43
44
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 42

def password_check_lifetime
  @password_check_lifetime
end

#resource_owner_typeObject

Returns the value of attribute resource_owner_type.



69
70
71
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 69

def resource_owner_type
  @resource_owner_type
end

#second_factor_check_lifetimeObject

Defines after how long the second factor check is valid.



51
52
53
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 51

def second_factor_check_lifetime
  @second_factor_check_lifetime
end

#second_factorsObject

Returns the value of attribute second_factors.



56
57
58
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 56

def second_factors
  @second_factors
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 352

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name
    # MODIFIED: Ensure model is looked up in the Models namespace
    # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails")
    klass = Zitadel::Client::Models.const_get(type)
    # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache)
    # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself)
    if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf)
      klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method
    else
      klass.build_from_hash(value) # For regular models
    end
  end
end

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



123
124
125
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 123

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



128
129
130
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 128

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 97

def self.attribute_map
  {
    :'allow_username_password' => :'allowUsernamePassword',
    :'allow_register' => :'allowRegister',
    :'allow_external_idp' => :'allowExternalIdp',
    :'force_mfa' => :'forceMfa',
    :'passkeys_type' => :'passkeysType',
    :'hide_password_reset' => :'hidePasswordReset',
    :'ignore_unknown_usernames' => :'ignoreUnknownUsernames',
    :'default_redirect_uri' => :'defaultRedirectUri',
    :'password_check_lifetime' => :'passwordCheckLifetime',
    :'external_login_check_lifetime' => :'externalLoginCheckLifetime',
    :'mfa_init_skip_lifetime' => :'mfaInitSkipLifetime',
    :'second_factor_check_lifetime' => :'secondFactorCheckLifetime',
    :'multi_factor_check_lifetime' => :'multiFactorCheckLifetime',
    :'second_factors' => :'secondFactors',
    :'multi_factors' => :'multiFactors',
    :'allow_domain_discovery' => :'allowDomainDiscovery',
    :'disable_login_with_email' => :'disableLoginWithEmail',
    :'disable_login_with_phone' => :'disableLoginWithPhone',
    :'resource_owner_type' => :'resourceOwnerType',
    :'force_mfa_local_only' => :'forceMfaLocalOnly'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Models attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 328

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash) # `new` will call the initialize method of the specific model class.
end

.openapi_nullableObject

List of attributes with nullable: true



159
160
161
162
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 159

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 133

def self.openapi_types
  {
    :'allow_username_password' => :'Boolean',
    :'allow_register' => :'Boolean',
    :'allow_external_idp' => :'Boolean',
    :'force_mfa' => :'Boolean',
    :'passkeys_type' => :'SettingsServicePasskeysType',
    :'hide_password_reset' => :'Boolean',
    :'ignore_unknown_usernames' => :'Boolean',
    :'default_redirect_uri' => :'String',
    :'password_check_lifetime' => :'String',
    :'external_login_check_lifetime' => :'String',
    :'mfa_init_skip_lifetime' => :'String',
    :'second_factor_check_lifetime' => :'String',
    :'multi_factor_check_lifetime' => :'String',
    :'second_factors' => :'Array<SettingsServiceSecondFactorType>',
    :'multi_factors' => :'Array<SettingsServiceMultiFactorType>',
    :'allow_domain_discovery' => :'Boolean',
    :'disable_login_with_email' => :'Boolean',
    :'disable_login_with_phone' => :'Boolean',
    :'resource_owner_type' => :'SettingsServiceResourceOwnerType',
    :'force_mfa_local_only' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 288

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      allow_username_password == o.allow_username_password &&
      allow_register == o.allow_register &&
      allow_external_idp == o.allow_external_idp &&
      force_mfa == o.force_mfa &&
      passkeys_type == o.passkeys_type &&
      hide_password_reset == o.hide_password_reset &&
      ignore_unknown_usernames == o.ignore_unknown_usernames &&
      default_redirect_uri == o.default_redirect_uri &&
      password_check_lifetime == o.password_check_lifetime &&
       == o. &&
      mfa_init_skip_lifetime == o.mfa_init_skip_lifetime &&
      second_factor_check_lifetime == o.second_factor_check_lifetime &&
      multi_factor_check_lifetime == o.multi_factor_check_lifetime &&
      second_factors == o.second_factors &&
      multi_factors == o.multi_factors &&
      allow_domain_discovery == o.allow_domain_discovery &&
       == o. &&
       == o. &&
      resource_owner_type == o.resource_owner_type &&
      force_mfa_local_only == o.force_mfa_local_only
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



431
432
433
434
435
436
437
438
439
440
441
442
443
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 431

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


315
316
317
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 315

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



321
322
323
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 321

def hash
  [allow_username_password, allow_register, allow_external_idp, force_mfa, passkeys_type, hide_password_reset, ignore_unknown_usernames, default_redirect_uri, password_check_lifetime, , mfa_init_skip_lifetime, second_factor_check_lifetime, multi_factor_check_lifetime, second_factors, multi_factors, allow_domain_discovery, , , resource_owner_type, force_mfa_local_only].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



273
274
275
276
277
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 273

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



407
408
409
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 407

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 413

def to_hash
  hash = {} # Calls super.to_hash if parent exists
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



401
402
403
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 401

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



281
282
283
284
# File 'lib/zitadel/client/models/settings_service_login_settings.rb', line 281

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end