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



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
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
# File 'lib/authentik/api/models/current_brand.rb', line 139

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?(:'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_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?(:'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_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.



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

def default_locale
  @default_locale
end

#flagsObject

Returns the value of attribute flags.



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

def flags
  @flags
end

#flow_authenticationObject

Returns the value of attribute flow_authentication.



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

def flow_authentication
  @flow_authentication
end

#flow_device_codeObject

Returns the value of attribute flow_device_code.



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

def flow_device_code
  @flow_device_code
end

#flow_invalidationObject

Returns the value of attribute flow_invalidation.



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

def flow_invalidation
  @flow_invalidation
end

#flow_lockdownObject

Returns the value of attribute flow_lockdown.



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

def flow_lockdown
  @flow_lockdown
end

#flow_recoveryObject

Returns the value of attribute flow_recovery.



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

def flow_recovery
  @flow_recovery
end

#flow_unenrollmentObject

Returns the value of attribute flow_unenrollment.



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

def flow_unenrollment
  @flow_unenrollment
end

#flow_user_settingsObject

Returns the value of attribute flow_user_settings.



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

def 
  @flow_user_settings
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.



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

def ui_footer_links
  @ui_footer_links
end

#ui_themeObject

Returns the value of attribute ui_theme.



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

def ui_theme
  @ui_theme
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



96
97
98
# File 'lib/authentik/api/models/current_brand.rb', line 96

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



101
102
103
# File 'lib/authentik/api/models/current_brand.rb', line 101

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/authentik/api/models/current_brand.rb', line 72

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',
    :'ui_footer_links' => :'ui_footer_links',
    :'ui_theme' => :'ui_theme',
    :'flow_authentication' => :'flow_authentication',
    :'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',
    :'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



440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/authentik/api/models/current_brand.rb', line 440

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



130
131
132
133
134
135
# File 'lib/authentik/api/models/current_brand.rb', line 130

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

.openapi_typesObject

Attribute type mapping.



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/authentik/api/models/current_brand.rb', line 106

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',
    :'ui_footer_links' => :'Array<FooterLink>',
    :'ui_theme' => :'UiThemeEnum',
    :'flow_authentication' => :'String',
    :'flow_invalidation' => :'String',
    :'flow_recovery' => :'String',
    :'flow_unenrollment' => :'String',
    :'flow_user_settings' => :'String',
    :'flow_device_code' => :'String',
    :'flow_lockdown' => :'String',
    :'default_locale' => :'String',
    :'flags' => :'CurrentBrandFlags'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
# File 'lib/authentik/api/models/current_brand.rb', line 402

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 &&
      ui_footer_links == o.ui_footer_links &&
      ui_theme == o.ui_theme &&
      flow_authentication == o.flow_authentication &&
      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 &&
      default_locale == o.default_locale &&
      flags == o.flags
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


427
428
429
# File 'lib/authentik/api/models/current_brand.rb', line 427

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



433
434
435
# File 'lib/authentik/api/models/current_brand.rb', line 433

def hash
  [matched_domain, branding_title, , branding_logo_themed_urls, branding_favicon, branding_favicon_themed_urls, branding_custom_css, ui_footer_links, ui_theme, flow_authentication, flow_invalidation, flow_recovery, flow_unenrollment, , flow_device_code, flow_lockdown, 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



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/authentik/api/models/current_brand.rb', line 252

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 @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



462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/authentik/api/models/current_brand.rb', line 462

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



296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/authentik/api/models/current_brand.rb', line 296

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 @ui_footer_links.nil?
  return false if @ui_theme.nil?
  return false if @default_locale.nil?
  return false if @flags.nil?
  true
end