Class: Authentik::Api::CurrentBrand

Inherits:
ApiModelBase show all
Defined in:
lib/authentik/api/models/current_brand.rb

Overview

Partial brand information for styling

Defined Under Namespace

Classes: EnumAttributeValidator

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 = {}) ⇒ CurrentBrand

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
270
271
272
273
274
# File 'lib/authentik/api/models/current_brand.rb', line 151

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::CurrentBrand` 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::CurrentBrand`. 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?(:'matched_domain')
    self.matched_domain = attributes[:'matched_domain']
  else
    self.matched_domain = nil
  end

  if attributes.key?(:'branding_title')
    self.branding_title = attributes[:'branding_title']
  else
    self.branding_title = nil
  end

  if attributes.key?(:'branding_logo')
    self. = attributes[:'branding_logo']
  else
    self. = nil
  end

  if attributes.key?(:'branding_logo_themed_urls')
    self.branding_logo_themed_urls = attributes[:'branding_logo_themed_urls']
  else
    self.branding_logo_themed_urls = nil
  end

  if attributes.key?(:'branding_favicon')
    self.branding_favicon = attributes[:'branding_favicon']
  else
    self.branding_favicon = nil
  end

  if attributes.key?(:'branding_favicon_themed_urls')
    self.branding_favicon_themed_urls = attributes[:'branding_favicon_themed_urls']
  else
    self.branding_favicon_themed_urls = nil
  end

  if attributes.key?(:'branding_custom_css')
    self.branding_custom_css = attributes[:'branding_custom_css']
  else
    self.branding_custom_css = nil
  end

  if attributes.key?(:'branding_map_tiles')
    self.branding_map_tiles = attributes[:'branding_map_tiles']
  else
    self.branding_map_tiles = nil
  end

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

  if attributes.key?(:'ui_theme')
    self.ui_theme = attributes[:'ui_theme']
  else
    self.ui_theme = nil
  end

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

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

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

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

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

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

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

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

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

  if attributes.key?(:'default_locale')
    self.default_locale = attributes[:'default_locale']
  else
    self.default_locale = nil
  end

  if attributes.key?(:'flags')
    self.flags = attributes[:'flags']
  else
    self.flags = nil
  end
end

Instance Attribute Details

#branding_custom_cssObject

Returns the value of attribute branding_custom_css.



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

def branding_custom_css
  @branding_custom_css
end

#branding_faviconObject

Returns the value of attribute branding_favicon.



21
22
23
# File 'lib/authentik/api/models/current_brand.rb', line 21

def branding_favicon
  @branding_favicon
end

#branding_favicon_themed_urlsObject

Returns the value of attribute branding_favicon_themed_urls.



23
24
25
# File 'lib/authentik/api/models/current_brand.rb', line 23

def branding_favicon_themed_urls
  @branding_favicon_themed_urls
end

#branding_logoObject

Returns the value of attribute branding_logo.



17
18
19
# File 'lib/authentik/api/models/current_brand.rb', line 17

def 
  @branding_logo
end

#branding_logo_themed_urlsObject

Returns the value of attribute branding_logo_themed_urls.



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

def branding_logo_themed_urls
  @branding_logo_themed_urls
end

#branding_map_tilesObject

Returns the value of attribute branding_map_tiles.



27
28
29
# File 'lib/authentik/api/models/current_brand.rb', line 27

def branding_map_tiles
  @branding_map_tiles
end

#branding_titleObject

Returns the value of attribute branding_title.



15
16
17
# File 'lib/authentik/api/models/current_brand.rb', line 15

def branding_title
  @branding_title
end

#default_localeObject

Returns the value of attribute default_locale.



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

def default_locale
  @default_locale
end

#flagsObject

Returns the value of attribute flags.



53
54
55
# File 'lib/authentik/api/models/current_brand.rb', line 53

def flags
  @flags
end

#flow_authenticationObject

Returns the value of attribute flow_authentication.



33
34
35
# File 'lib/authentik/api/models/current_brand.rb', line 33

def flow_authentication
  @flow_authentication
end

#flow_device_codeObject

Returns the value of attribute flow_device_code.



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

def flow_device_code
  @flow_device_code
end

#flow_invalidationObject

Returns the value of attribute flow_invalidation.



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

def flow_invalidation
  @flow_invalidation
end

#flow_lockdownObject

Returns the value of attribute flow_lockdown.



47
48
49
# File 'lib/authentik/api/models/current_brand.rb', line 47

def flow_lockdown
  @flow_lockdown
end

#flow_recoveryObject

Returns the value of attribute flow_recovery.



39
40
41
# File 'lib/authentik/api/models/current_brand.rb', line 39

def flow_recovery
  @flow_recovery
end

#flow_requestObject

Returns the value of attribute flow_request.



49
50
51
# File 'lib/authentik/api/models/current_brand.rb', line 49

def flow_request
  @flow_request
end

#flow_unenrollmentObject

Returns the value of attribute flow_unenrollment.



41
42
43
# File 'lib/authentik/api/models/current_brand.rb', line 41

def flow_unenrollment
  @flow_unenrollment
end

#flow_user_settingsObject

Returns the value of attribute flow_user_settings.



43
44
45
# File 'lib/authentik/api/models/current_brand.rb', line 43

def 
  @flow_user_settings
end

#flow_user_switchObject

Returns the value of attribute flow_user_switch.



35
36
37
# File 'lib/authentik/api/models/current_brand.rb', line 35

def flow_user_switch
  @flow_user_switch
end

#matched_domainObject

Returns the value of attribute matched_domain.



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

def matched_domain
  @matched_domain
end

Returns the value of attribute ui_footer_links.



29
30
31
# File 'lib/authentik/api/models/current_brand.rb', line 29

def ui_footer_links
  @ui_footer_links
end

#ui_themeObject

Returns the value of attribute ui_theme.



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

def ui_theme
  @ui_theme
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



105
106
107
# File 'lib/authentik/api/models/current_brand.rb', line 105

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



110
111
112
# File 'lib/authentik/api/models/current_brand.rb', line 110

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/authentik/api/models/current_brand.rb', line 78

def self.attribute_map
  {
    :'matched_domain' => :'matched_domain',
    :'branding_title' => :'branding_title',
    :'branding_logo' => :'branding_logo',
    :'branding_logo_themed_urls' => :'branding_logo_themed_urls',
    :'branding_favicon' => :'branding_favicon',
    :'branding_favicon_themed_urls' => :'branding_favicon_themed_urls',
    :'branding_custom_css' => :'branding_custom_css',
    :'branding_map_tiles' => :'branding_map_tiles',
    :'ui_footer_links' => :'ui_footer_links',
    :'ui_theme' => :'ui_theme',
    :'flow_authentication' => :'flow_authentication',
    :'flow_user_switch' => :'flow_user_switch',
    :'flow_invalidation' => :'flow_invalidation',
    :'flow_recovery' => :'flow_recovery',
    :'flow_unenrollment' => :'flow_unenrollment',
    :'flow_user_settings' => :'flow_user_settings',
    :'flow_device_code' => :'flow_device_code',
    :'flow_lockdown' => :'flow_lockdown',
    :'flow_request' => :'flow_request',
    :'default_locale' => :'default_locale',
    :'flags' => :'flags'
  }
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



484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
# File 'lib/authentik/api/models/current_brand.rb', line 484

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



142
143
144
145
146
147
# File 'lib/authentik/api/models/current_brand.rb', line 142

def self.openapi_nullable
  Set.new([
    :'branding_logo_themed_urls',
    :'branding_favicon_themed_urls',
  ])
end

.openapi_typesObject

Attribute type mapping.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/authentik/api/models/current_brand.rb', line 115

def self.openapi_types
  {
    :'matched_domain' => :'String',
    :'branding_title' => :'String',
    :'branding_logo' => :'String',
    :'branding_logo_themed_urls' => :'ThemedUrls',
    :'branding_favicon' => :'String',
    :'branding_favicon_themed_urls' => :'ThemedUrls',
    :'branding_custom_css' => :'String',
    :'branding_map_tiles' => :'String',
    :'ui_footer_links' => :'Array<FooterLink>',
    :'ui_theme' => :'UiThemeEnum',
    :'flow_authentication' => :'String',
    :'flow_user_switch' => :'String',
    :'flow_invalidation' => :'String',
    :'flow_recovery' => :'String',
    :'flow_unenrollment' => :'String',
    :'flow_user_settings' => :'String',
    :'flow_device_code' => :'String',
    :'flow_lockdown' => :'String',
    :'flow_request' => :'String',
    :'default_locale' => :'String',
    :'flags' => :'CurrentBrandFlags'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
# File 'lib/authentik/api/models/current_brand.rb', line 443

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      matched_domain == o.matched_domain &&
      branding_title == o.branding_title &&
       == o. &&
      branding_logo_themed_urls == o.branding_logo_themed_urls &&
      branding_favicon == o.branding_favicon &&
      branding_favicon_themed_urls == o.branding_favicon_themed_urls &&
      branding_custom_css == o.branding_custom_css &&
      branding_map_tiles == o.branding_map_tiles &&
      ui_footer_links == o.ui_footer_links &&
      ui_theme == o.ui_theme &&
      flow_authentication == o.flow_authentication &&
      flow_user_switch == o.flow_user_switch &&
      flow_invalidation == o.flow_invalidation &&
      flow_recovery == o.flow_recovery &&
      flow_unenrollment == o.flow_unenrollment &&
       == o. &&
      flow_device_code == o.flow_device_code &&
      flow_lockdown == o.flow_lockdown &&
      flow_request == o.flow_request &&
      default_locale == o.default_locale &&
      flags == o.flags
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


471
472
473
# File 'lib/authentik/api/models/current_brand.rb', line 471

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



477
478
479
# File 'lib/authentik/api/models/current_brand.rb', line 477

def hash
  [matched_domain, branding_title, , branding_logo_themed_urls, branding_favicon, branding_favicon_themed_urls, branding_custom_css, branding_map_tiles, ui_footer_links, ui_theme, flow_authentication, flow_user_switch, flow_invalidation, flow_recovery, flow_unenrollment, , flow_device_code, flow_lockdown, flow_request, default_locale, flags].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/authentik/api/models/current_brand.rb', line 278

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @matched_domain.nil?
    invalid_properties.push('invalid value for "matched_domain", matched_domain cannot be nil.')
  end

  if @branding_title.nil?
    invalid_properties.push('invalid value for "branding_title", branding_title cannot be nil.')
  end

  if @branding_logo.nil?
    invalid_properties.push('invalid value for "branding_logo", branding_logo cannot be nil.')
  end

  if @branding_favicon.nil?
    invalid_properties.push('invalid value for "branding_favicon", branding_favicon cannot be nil.')
  end

  if @branding_custom_css.nil?
    invalid_properties.push('invalid value for "branding_custom_css", branding_custom_css cannot be nil.')
  end

  if @branding_map_tiles.nil?
    invalid_properties.push('invalid value for "branding_map_tiles", branding_map_tiles cannot be nil.')
  end

  if @ui_footer_links.nil?
    invalid_properties.push('invalid value for "ui_footer_links", ui_footer_links cannot be nil.')
  end

  if @ui_theme.nil?
    invalid_properties.push('invalid value for "ui_theme", ui_theme cannot be nil.')
  end

  if @default_locale.nil?
    invalid_properties.push('invalid value for "default_locale", default_locale cannot be nil.')
  end

  if @flags.nil?
    invalid_properties.push('invalid value for "flags", flags cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



506
507
508
509
510
511
512
513
514
515
516
517
518
# File 'lib/authentik/api/models/current_brand.rb', line 506

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



326
327
328
329
330
331
332
333
334
335
336
337
338
339
# File 'lib/authentik/api/models/current_brand.rb', line 326

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @matched_domain.nil?
  return false if @branding_title.nil?
  return false if @branding_logo.nil?
  return false if @branding_favicon.nil?
  return false if @branding_custom_css.nil?
  return false if @branding_map_tiles.nil?
  return false if @ui_footer_links.nil?
  return false if @ui_theme.nil?
  return false if @default_locale.nil?
  return false if @flags.nil?
  true
end