Class: MistApi::NacPortalTemplate
- Defined in:
- lib/mist_api/models/nac_portal_template.rb
Overview
NacPortalTemplate Model.
Instance Attribute Summary collapse
-
#alignment ⇒ PortalTemplateAlignmentEnum
defines alignment on portal.
-
#color ⇒ String
defines alignment on portal.
-
#logo ⇒ String
Custom logo custom logo with “data:image/png;base64,” format.
-
#powered_by ⇒ TrueClass | FalseClass
Whether to hide “Powered by Juniper Mist” and email footers.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(alignment = PortalTemplateAlignmentEnum::CENTER, color = '#1074bc', logo = SKIP, powered_by = false, additional_properties = nil) ⇒ NacPortalTemplate
constructor
A new instance of NacPortalTemplate.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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', logo = 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 = logo unless logo == SKIP @powered_by = powered_by unless powered_by == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#alignment ⇒ PortalTemplateAlignmentEnum
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 |
#color ⇒ String
defines alignment on portal. enum: ‘center`, `left`, `right`
18 19 20 |
# File 'lib/mist_api/models/nac_portal_template.rb', line 18 def color @color end |
#logo ⇒ String
Custom logo custom logo with “data:image/png;base64,” format. default null, uses Juniper Mist Logo.
23 24 25 |
# File 'lib/mist_api/models/nac_portal_template.rb', line 23 def logo @logo end |
#powered_by ⇒ TrueClass | FalseClass
Whether to hide “Powered by Juniper Mist” and email footers
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' logo = 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, logo, powered_by, additional_properties) end |
.names ⇒ Object
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 |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/mist_api/models/nac_portal_template.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
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
#inspect ⇒ Object
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_s ⇒ Object
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 |