Class: Authentik::Api::PatchedIdentificationStageRequest

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/authentik/api/models/patched_identification_stage_request.rb

Overview

IdentificationStage Serializer

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ PatchedIdentificationStageRequest

Initializes the object

Parameters:

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

    Model attributes in the form of hash



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
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
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 117

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::PatchedIdentificationStageRequest` 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))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::PatchedIdentificationStageRequest`. 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?(:'name')
    self.name = attributes[:'name']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#captcha_stageObject

When set, adds functionality exactly like a Captcha stage, but baked into the Identification stage.



22
23
24
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 22

def captcha_stage
  @captcha_stage
end

#case_insensitive_matchingObject

When enabled, user fields are matched regardless of their casing.



25
26
27
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 25

def case_insensitive_matching
  @case_insensitive_matching
end

#enable_remember_meObject

Show the user the ‘Remember me on this device’ toggle, allowing repeat users to skip straight to entering their password.



48
49
50
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 48

def enable_remember_me
  @enable_remember_me
end

#enrollment_flowObject

Optional enrollment flow, which is linked at the bottom of the page.



31
32
33
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 31

def enrollment_flow
  @enrollment_flow
end

#nameObject

Returns the value of attribute name.



13
14
15
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 13

def name
  @name
end

#password_stageObject

When set, shows a password field, instead of showing the password field as separate step.



19
20
21
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 19

def password_stage
  @password_stage
end

#passwordless_flowObject

Optional passwordless flow, which is linked at the bottom of the page.



37
38
39
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 37

def passwordless_flow
  @passwordless_flow
end

#pretend_user_existsObject

When enabled, the stage will succeed and continue even when incorrect user info is entered.



45
46
47
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 45

def pretend_user_exists
  @pretend_user_exists
end

#recovery_flowObject

Optional recovery flow, which is linked at the bottom of the page.



34
35
36
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 34

def recovery_flow
  @recovery_flow
end

#show_matched_userObject

When a valid username/email has been entered, and this option is enabled, the user’s username and avatar will be shown. Otherwise, the text that the user entered will be shown



28
29
30
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 28

def show_matched_user
  @show_matched_user
end

#show_source_labelsObject

Returns the value of attribute show_source_labels.



42
43
44
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 42

def show_source_labels
  @show_source_labels
end

#sourcesObject

Specify which sources should be shown.



40
41
42
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 40

def sources
  @sources
end

#user_fieldsObject

Fields of the user object to match against. (Hold shift to select multiple options)



16
17
18
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 16

def user_fields
  @user_fields
end

#webauthn_stageObject

When set, and conditional WebAuthn is available, allow the user to use their passkey as a first factor.



51
52
53
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 51

def webauthn_stage
  @webauthn_stage
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



74
75
76
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 74

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



79
80
81
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 79

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 54

def self.attribute_map
  {
    :'name' => :'name',
    :'user_fields' => :'user_fields',
    :'password_stage' => :'password_stage',
    :'captcha_stage' => :'captcha_stage',
    :'case_insensitive_matching' => :'case_insensitive_matching',
    :'show_matched_user' => :'show_matched_user',
    :'enrollment_flow' => :'enrollment_flow',
    :'recovery_flow' => :'recovery_flow',
    :'passwordless_flow' => :'passwordless_flow',
    :'sources' => :'sources',
    :'show_source_labels' => :'show_source_labels',
    :'pretend_user_exists' => :'pretend_user_exists',
    :'enable_remember_me' => :'enable_remember_me',
    :'webauthn_stage' => :'webauthn_stage'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 262

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)
end

.openapi_nullableObject

List of attributes with nullable: true



104
105
106
107
108
109
110
111
112
113
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 104

def self.openapi_nullable
  Set.new([
    :'password_stage',
    :'captcha_stage',
    :'enrollment_flow',
    :'recovery_flow',
    :'passwordless_flow',
    :'webauthn_stage'
  ])
end

.openapi_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 84

def self.openapi_types
  {
    :'name' => :'String',
    :'user_fields' => :'Array<UserFieldsEnum>',
    :'password_stage' => :'String',
    :'captcha_stage' => :'String',
    :'case_insensitive_matching' => :'Boolean',
    :'show_matched_user' => :'Boolean',
    :'enrollment_flow' => :'String',
    :'recovery_flow' => :'String',
    :'passwordless_flow' => :'String',
    :'sources' => :'Array<String>',
    :'show_source_labels' => :'Boolean',
    :'pretend_user_exists' => :'Boolean',
    :'enable_remember_me' => :'Boolean',
    :'webauthn_stage' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 228

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      name == o.name &&
      user_fields == o.user_fields &&
      password_stage == o.password_stage &&
      captcha_stage == o.captcha_stage &&
      case_insensitive_matching == o.case_insensitive_matching &&
      show_matched_user == o.show_matched_user &&
      enrollment_flow == o.enrollment_flow &&
      recovery_flow == o.recovery_flow &&
      passwordless_flow == o.passwordless_flow &&
      sources == o.sources &&
      show_source_labels == o.show_source_labels &&
      pretend_user_exists == o.pretend_user_exists &&
      enable_remember_me == o.enable_remember_me &&
      webauthn_stage == o.webauthn_stage
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


249
250
251
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 249

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



255
256
257
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 255

def hash
  [name, user_fields, password_stage, captcha_stage, case_insensitive_matching, show_matched_user, enrollment_flow, recovery_flow, passwordless_flow, sources, show_source_labels, pretend_user_exists, enable_remember_me, webauthn_stage].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



194
195
196
197
198
199
200
201
202
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 194

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if !@name.nil? && @name.to_s.length < 1
    invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 284

def to_hash
  hash = {}
  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

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



206
207
208
209
210
# File 'lib/authentik/api/models/patched_identification_stage_request.rb', line 206

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if !@name.nil? && @name.to_s.length < 1
  true
end