Class: Comet::ServerConfigOptions
- Inherits:
-
Object
- Object
- Comet::ServerConfigOptions
- Defined in:
- lib/comet/models/server_config_options.rb
Overview
ServerConfigOptions is a typed class wrapper around the underlying Comet Server API data structure.
Instance Attribute Summary collapse
-
#admin_users ⇒ Object
Returns the value of attribute admin_users.
-
#authentication_role ⇒ Object
Returns the value of attribute authentication_role.
-
#branding ⇒ Object
Returns the value of attribute branding.
-
#constellation_role ⇒ Object
Returns the value of attribute constellation_role.
-
#constellation_role__legacy ⇒ Object
Returns the value of attribute constellation_role__legacy.
-
#email ⇒ Object
Returns the value of attribute email.
-
#experimental_options ⇒ Object
Returns the value of attribute experimental_options.
-
#external_admin_user_sources ⇒ Object
Returns the value of attribute external_admin_user_sources.
-
#iprate_limit ⇒ Object
Returns the value of attribute iprate_limit.
-
#license ⇒ Object
Returns the value of attribute license.
-
#listen_addresses ⇒ Object
Returns the value of attribute listen_addresses.
-
#organizations ⇒ Object
Returns the value of attribute organizations.
-
#self_backup ⇒ Object
Returns the value of attribute self_backup.
-
#session_settings ⇒ Object
Returns the value of attribute session_settings.
-
#software_build_role ⇒ Object
Returns the value of attribute software_build_role.
-
#storage_role ⇒ Object
Returns the value of attribute storage_role.
-
#trust_xforwarded_for ⇒ Object
Returns the value of attribute trust_xforwarded_for.
-
#unknown_json_fields ⇒ Object
Returns the value of attribute unknown_json_fields.
-
#webhook_options ⇒ Object
Returns the value of attribute webhook_options.
Instance Method Summary collapse
- #clear ⇒ Object
- #from_hash(obj) ⇒ Object
- #from_json(json_string) ⇒ Object
-
#initialize ⇒ ServerConfigOptions
constructor
A new instance of ServerConfigOptions.
-
#to_h ⇒ Hash
The complete object as a Ruby hash.
-
#to_hash ⇒ Hash
The complete object as a Ruby hash.
-
#to_json(options = {}) ⇒ String
The complete object as a JSON string.
Constructor Details
#initialize ⇒ ServerConfigOptions
Returns a new instance of ServerConfigOptions.
72 73 74 |
# File 'lib/comet/models/server_config_options.rb', line 72 def initialize clear end |
Instance Attribute Details
#admin_users ⇒ Object
Returns the value of attribute admin_users.
28 29 30 |
# File 'lib/comet/models/server_config_options.rb', line 28 def admin_users @admin_users end |
#authentication_role ⇒ Object
Returns the value of attribute authentication_role.
49 50 51 |
# File 'lib/comet/models/server_config_options.rb', line 49 def authentication_role @authentication_role end |
#branding ⇒ Object
Returns the value of attribute branding.
25 26 27 |
# File 'lib/comet/models/server_config_options.rb', line 25 def branding @branding end |
#constellation_role ⇒ Object
Returns the value of attribute constellation_role.
58 59 60 |
# File 'lib/comet/models/server_config_options.rb', line 58 def constellation_role @constellation_role end |
#constellation_role__legacy ⇒ Object
Returns the value of attribute constellation_role__legacy.
61 62 63 |
# File 'lib/comet/models/server_config_options.rb', line 61 def constellation_role__legacy @constellation_role__legacy end |
#email ⇒ Object
Returns the value of attribute email.
46 47 48 |
# File 'lib/comet/models/server_config_options.rb', line 46 def email @email end |
#experimental_options ⇒ Object
Returns the value of attribute experimental_options.
16 17 18 |
# File 'lib/comet/models/server_config_options.rb', line 16 def @experimental_options end |
#external_admin_user_sources ⇒ Object
Returns the value of attribute external_admin_user_sources.
34 35 36 |
# File 'lib/comet/models/server_config_options.rb', line 34 def external_admin_user_sources @external_admin_user_sources end |
#iprate_limit ⇒ Object
Returns the value of attribute iprate_limit.
43 44 45 |
# File 'lib/comet/models/server_config_options.rb', line 43 def iprate_limit @iprate_limit end |
#license ⇒ Object
Returns the value of attribute license.
22 23 24 |
# File 'lib/comet/models/server_config_options.rb', line 22 def license @license end |
#listen_addresses ⇒ Object
Returns the value of attribute listen_addresses.
37 38 39 |
# File 'lib/comet/models/server_config_options.rb', line 37 def listen_addresses @listen_addresses end |
#organizations ⇒ Object
Returns the value of attribute organizations.
31 32 33 |
# File 'lib/comet/models/server_config_options.rb', line 31 def organizations @organizations end |
#self_backup ⇒ Object
Returns the value of attribute self_backup.
64 65 66 |
# File 'lib/comet/models/server_config_options.rb', line 64 def self_backup @self_backup end |
#session_settings ⇒ Object
Returns the value of attribute session_settings.
67 68 69 |
# File 'lib/comet/models/server_config_options.rb', line 67 def session_settings @session_settings end |
#software_build_role ⇒ Object
Returns the value of attribute software_build_role.
55 56 57 |
# File 'lib/comet/models/server_config_options.rb', line 55 def software_build_role @software_build_role end |
#storage_role ⇒ Object
Returns the value of attribute storage_role.
52 53 54 |
# File 'lib/comet/models/server_config_options.rb', line 52 def storage_role @storage_role end |
#trust_xforwarded_for ⇒ Object
Returns the value of attribute trust_xforwarded_for.
40 41 42 |
# File 'lib/comet/models/server_config_options.rb', line 40 def trust_xforwarded_for @trust_xforwarded_for end |
#unknown_json_fields ⇒ Object
Returns the value of attribute unknown_json_fields.
70 71 72 |
# File 'lib/comet/models/server_config_options.rb', line 70 def unknown_json_fields @unknown_json_fields end |
#webhook_options ⇒ Object
Returns the value of attribute webhook_options.
19 20 21 |
# File 'lib/comet/models/server_config_options.rb', line 19 def @webhook_options end |
Instance Method Details
#clear ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/comet/models/server_config_options.rb', line 76 def clear @experimental_options = [] @webhook_options = {} @license = Comet::LicenseOptions.new @branding = Comet::BrandingOptions.new @admin_users = [] @organizations = {} @external_admin_user_sources = {} @listen_addresses = [] @iprate_limit = Comet::RatelimitOptions.new @email = Comet::EmailOptions.new @authentication_role = Comet::AuthenticationRoleOptions.new @storage_role = Comet::StorageRoleOptions.new @software_build_role = Comet::SoftwareBuildRoleOptions.new @constellation_role = Comet::ConstellationRoleOptions.new @constellation_role__legacy = Comet::ConstellationRoleOptions.new @self_backup = Comet::SelfBackupOptions.new @session_settings = Comet::SessionOptions.new @unknown_json_fields = {} end |
#from_hash(obj) ⇒ Object
105 106 107 108 109 110 111 112 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 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 |
# File 'lib/comet/models/server_config_options.rb', line 105 def from_hash(obj) raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash obj.each do |k, v| case k when 'ExperimentalOptions' if v.nil? @experimental_options = [] else @experimental_options = Array.new(v.length) v.each_with_index do |v1, i1| raise TypeError, "'v1' expected String, got #{v1.class}" unless v1.is_a? String @experimental_options[i1] = v1 end end when 'WebhookOptions' @webhook_options = {} if v.nil? @webhook_options = {} else v.each do |k1, v1| @webhook_options[k1] = Comet::WebhookOption.new @webhook_options[k1].from_hash(v1) end end when 'License' @license = Comet::LicenseOptions.new @license.from_hash(v) when 'Branding' @branding = Comet::BrandingOptions.new @branding.from_hash(v) when 'AdminUsers' if v.nil? @admin_users = [] else @admin_users = Array.new(v.length) v.each_with_index do |v1, i1| @admin_users[i1] = Comet::AllowedAdminUser.new @admin_users[i1].from_hash(v1) end end when 'Organizations' @organizations = {} if v.nil? @organizations = {} else v.each do |k1, v1| @organizations[k1] = Comet::Organization.new @organizations[k1].from_hash(v1) end end when 'ExternalAdminUserSources' @external_admin_user_sources = {} if v.nil? @external_admin_user_sources = {} else v.each do |k1, v1| @external_admin_user_sources[k1] = Comet::ExternalAuthenticationSource.new @external_admin_user_sources[k1].from_hash(v1) end end when 'ListenAddresses' if v.nil? @listen_addresses = [] else @listen_addresses = Array.new(v.length) v.each_with_index do |v1, i1| @listen_addresses[i1] = Comet::HTTPConnectorOptions.new @listen_addresses[i1].from_hash(v1) end end when 'TrustXForwardedFor' @trust_xforwarded_for = v when 'IPRateLimit' @iprate_limit = Comet::RatelimitOptions.new @iprate_limit.from_hash(v) when 'Email' @email = Comet::EmailOptions.new @email.from_hash(v) when 'AuthenticationRole' @authentication_role = Comet::AuthenticationRoleOptions.new @authentication_role.from_hash(v) when 'StorageRole' @storage_role = Comet::StorageRoleOptions.new @storage_role.from_hash(v) when 'SoftwareBuildRole' @software_build_role = Comet::SoftwareBuildRoleOptions.new @software_build_role.from_hash(v) when 'ConstellationRole' @constellation_role = Comet::ConstellationRoleOptions.new @constellation_role.from_hash(v) when 'OverseerRole' @constellation_role__legacy = Comet::ConstellationRoleOptions.new @constellation_role__legacy.from_hash(v) when 'SelfBackup' @self_backup = Comet::SelfBackupOptions.new @self_backup.from_hash(v) when 'SessionSettings' @session_settings = Comet::SessionOptions.new @session_settings.from_hash(v) else @unknown_json_fields[k] = v end end end |
#from_json(json_string) ⇒ Object
98 99 100 101 102 |
# File 'lib/comet/models/server_config_options.rb', line 98 def from_json(json_string) raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String from_hash(JSON.parse(json_string)) end |
#to_h ⇒ Hash
Returns The complete object as a Ruby hash.
244 245 246 |
# File 'lib/comet/models/server_config_options.rb', line 244 def to_h to_hash end |
#to_hash ⇒ Hash
Returns The complete object as a Ruby hash.
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 |
# File 'lib/comet/models/server_config_options.rb', line 213 def to_hash ret = {} unless @experimental_options.nil? ret['ExperimentalOptions'] = @experimental_options end ret['WebhookOptions'] = @webhook_options ret['License'] = @license ret['Branding'] = @branding ret['AdminUsers'] = @admin_users ret['Organizations'] = @organizations ret['ExternalAdminUserSources'] = @external_admin_user_sources ret['ListenAddresses'] = @listen_addresses ret['TrustXForwardedFor'] = @trust_xforwarded_for ret['IPRateLimit'] = @iprate_limit ret['Email'] = @email ret['AuthenticationRole'] = @authentication_role ret['StorageRole'] = @storage_role ret['SoftwareBuildRole'] = @software_build_role ret['ConstellationRole'] = @constellation_role unless @constellation_role__legacy.nil? ret['OverseerRole'] = @constellation_role__legacy end ret['SelfBackup'] = @self_backup ret['SessionSettings'] = @session_settings @unknown_json_fields.each do |k, v| ret[k] = v end ret end |
#to_json(options = {}) ⇒ String
Returns The complete object as a JSON string.
249 250 251 |
# File 'lib/comet/models/server_config_options.rb', line 249 def to_json( = {}) to_hash.to_json() end |