Class: MistApi::NacPortalTemplate

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/nac_portal_template.rb

Overview

NacPortalTemplate Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(alignment = PortalTemplateAlignmentEnum::CENTER, color = '#1074bc', logo = SKIP, powered_by = false, additional_properties = nil) ⇒ NacPortalTemplate

Returns a new instance of NacPortalTemplate.



54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/mist_api/models/nac_portal_template.rb', line 54

def initialize(alignment = PortalTemplateAlignmentEnum::CENTER,
               color = '#1074bc',  = SKIP, powered_by = false,
               additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @alignment = alignment unless alignment == SKIP
  @color = color unless color == SKIP
  @logo =  unless  == SKIP
  @powered_by = powered_by unless powered_by == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#alignmentPortalTemplateAlignmentEnum

defines alignment on portal. enum: ‘center`, `left`, `right`



14
15
16
# File 'lib/mist_api/models/nac_portal_template.rb', line 14

def alignment
  @alignment
end

#colorString

defines alignment on portal. enum: ‘center`, `left`, `right`

Returns:

  • (String)


18
19
20
# File 'lib/mist_api/models/nac_portal_template.rb', line 18

def color
  @color
end

#logoString

Custom logo custom logo with “data:image/png;base64,” format. default null, uses Juniper Mist Logo.

Returns:

  • (String)


23
24
25
# File 'lib/mist_api/models/nac_portal_template.rb', line 23

def 
  @logo
end

#powered_byTrueClass | FalseClass

Whether to hide “Powered by Juniper Mist” and email footers

Returns:

  • (TrueClass | FalseClass)


27
28
29
# File 'lib/mist_api/models/nac_portal_template.rb', line 27

def powered_by
  @powered_by
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/mist_api/models/nac_portal_template.rb', line 68

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  alignment = hash['alignment'] ||= PortalTemplateAlignmentEnum::CENTER
  color = hash['color'] ||= '#1074bc'
   = hash.key?('logo') ? hash['logo'] : SKIP
  powered_by = hash['poweredBy'] ||= false

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  NacPortalTemplate.new(alignment,
                        color,
                        ,
                        powered_by,
                        additional_properties)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
37
# File 'lib/mist_api/models/nac_portal_template.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['alignment'] = 'alignment'
  @_hash['color'] = 'color'
  @_hash['logo'] = 'logo'
  @_hash['powered_by'] = 'poweredBy'
  @_hash
end

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/mist_api/models/nac_portal_template.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
46
47
# File 'lib/mist_api/models/nac_portal_template.rb', line 40

def self.optionals
  %w[
    alignment
    color
    logo
    powered_by
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



100
101
102
103
104
105
# File 'lib/mist_api/models/nac_portal_template.rb', line 100

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} alignment: #{@alignment.inspect}, color: #{@color.inspect}, logo:"\
  " #{@logo.inspect}, powered_by: #{@powered_by.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



93
94
95
96
97
# File 'lib/mist_api/models/nac_portal_template.rb', line 93

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} alignment: #{@alignment}, color: #{@color}, logo: #{@logo}, powered_by:"\
  " #{@powered_by}, additional_properties: #{@additional_properties}>"
end