Class: MistApi::PskPortalTemplateSetting

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

Overview

PskPortalTemplateSetting 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, tos = SKIP, tos_accept_label = 'I accept the Terms of Service', tos_error = 'Please review and accept the Terms of Service', tos_link = 'Terms of Service', tos_text = '<< provide your Terms of Service here >>', tos_url = SKIP) ⇒ PskPortalTemplateSetting

Returns a new instance of PskPortalTemplateSetting.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/mist_api/models/psk_portal_template_setting.rb', line 92

def initialize(alignment = PortalTemplateAlignmentEnum::CENTER,
               color = '#1074bc',  = SKIP, powered_by = false,
               tos = SKIP,
               tos_accept_label = 'I accept the Terms of Service',
               tos_error = 'Please review and accept the Terms of Service',
               tos_link = 'Terms of Service',
               tos_text = '<< provide your Terms of Service here >>',
               tos_url = SKIP)
  @alignment = alignment unless alignment == SKIP
  @color = color unless color == SKIP
  @logo =  unless  == SKIP
  @powered_by = powered_by unless powered_by == SKIP
  @tos = tos unless tos == SKIP
  @tos_accept_label = tos_accept_label unless tos_accept_label == SKIP
  @tos_error = tos_error unless tos_error == SKIP
  @tos_link = tos_link unless tos_link == SKIP
  @tos_text = tos_text unless tos_text == SKIP
  @tos_url = tos_url unless tos_url == SKIP
end

Instance Attribute Details

#alignmentPortalTemplateAlignmentEnum

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



14
15
16
# File 'lib/mist_api/models/psk_portal_template_setting.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/psk_portal_template_setting.rb', line 18

def color
  @color
end

#logoString

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

Returns:

  • (String)


23
24
25
# File 'lib/mist_api/models/psk_portal_template_setting.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/psk_portal_template_setting.rb', line 27

def powered_by
  @powered_by
end

#tosTrueClass | FalseClass

Whether to show Terms of Service

Returns:

  • (TrueClass | FalseClass)


31
32
33
# File 'lib/mist_api/models/psk_portal_template_setting.rb', line 31

def tos
  @tos
end

#tos_accept_labelString

Terms of Service accept button label

Returns:

  • (String)


35
36
37
# File 'lib/mist_api/models/psk_portal_template_setting.rb', line 35

def tos_accept_label
  @tos_accept_label
end

#tos_errorString

Terror message for not accepting tos

Returns:

  • (String)


39
40
41
# File 'lib/mist_api/models/psk_portal_template_setting.rb', line 39

def tos_error
  @tos_error
end

Terror message for not accepting tos

Returns:

  • (String)


43
44
45
# File 'lib/mist_api/models/psk_portal_template_setting.rb', line 43

def tos_link
  @tos_link
end

#tos_textString

terms and service text displayed in footer if tos is enabled

Returns:

  • (String)


47
48
49
# File 'lib/mist_api/models/psk_portal_template_setting.rb', line 47

def tos_text
  @tos_text
end

#tos_urlString

customized url for defining terms of service

Returns:

  • (String)


51
52
53
# File 'lib/mist_api/models/psk_portal_template_setting.rb', line 51

def tos_url
  @tos_url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



113
114
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
140
141
# File 'lib/mist_api/models/psk_portal_template_setting.rb', line 113

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
  tos = hash.key?('tos') ? hash['tos'] : SKIP
  tos_accept_label =
    hash['tosAcceptLabel'] ||= 'I accept the Terms of Service'
  tos_error =
    hash['tosError'] ||= 'Please review and accept the Terms of Service'
  tos_link = hash['tosLink'] ||= 'Terms of Service'
  tos_text = hash['tosText'] ||= '<< provide your Terms of Service here >>'
  tos_url = hash.key?('tosUrl') ? hash['tosUrl'] : SKIP

  # Create object from extracted values.
  PskPortalTemplateSetting.new(alignment,
                               color,
                               ,
                               powered_by,
                               tos,
                               tos_accept_label,
                               tos_error,
                               tos_link,
                               tos_text,
                               tos_url)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['alignment'] = 'alignment'
  @_hash['color'] = 'color'
  @_hash['logo'] = 'logo'
  @_hash['powered_by'] = 'poweredBy'
  @_hash['tos'] = 'tos'
  @_hash['tos_accept_label'] = 'tosAcceptLabel'
  @_hash['tos_error'] = 'tosError'
  @_hash['tos_link'] = 'tosLink'
  @_hash['tos_text'] = 'tosText'
  @_hash['tos_url'] = 'tosUrl'
  @_hash
end

.nullablesObject

An array for nullable fields



86
87
88
89
90
# File 'lib/mist_api/models/psk_portal_template_setting.rb', line 86

def self.nullables
  %w[
    logo
  ]
end

.optionalsObject

An array for optional fields



70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/mist_api/models/psk_portal_template_setting.rb', line 70

def self.optionals
  %w[
    alignment
    color
    logo
    powered_by
    tos
    tos_accept_label
    tos_error
    tos_link
    tos_text
    tos_url
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



152
153
154
155
156
157
158
159
# File 'lib/mist_api/models/psk_portal_template_setting.rb', line 152

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}, tos: #{@tos.inspect},"\
  " tos_accept_label: #{@tos_accept_label.inspect}, tos_error: #{@tos_error.inspect},"\
  " tos_link: #{@tos_link.inspect}, tos_text: #{@tos_text.inspect}, tos_url:"\
  " #{@tos_url.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



144
145
146
147
148
149
# File 'lib/mist_api/models/psk_portal_template_setting.rb', line 144

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