class Comet::ServerConfigOptions

ServerConfigOptions is a typed class wrapper around the underlying Comet Server API data structure.

def clear

def clear
  @admin_users = []
  @authentication_role = Comet::AuthenticationRoleOptions.new
  @branding = Comet::BrandingOptions.new
  @constellation_role = Comet::ConstellationRoleOptions.new
  @constellation_role__legacy = Comet::ConstellationRoleOptions.new
  @email = Comet::EmailOptions.new
  @experimental_options = []
  @external_admin_user_sources = {}
  @iprate_limit = Comet::RatelimitOptions.new
  @license = Comet::LicenseOptions.new
  @listen_addresses = []
  @organizations = {}
  @psaconfigs = []
  @self_backup = Comet::SelfBackupOptions.new
  @session_settings = Comet::SessionOptions.new
  @software_build_role = Comet::SoftwareBuildRoleOptions.new
  @storage_role = Comet::StorageRoleOptions.new
  @webhook_options = {}
  @audit_file_options = {}
  @unknown_json_fields = {}
end

def from_hash(obj)

Parameters:
  • obj (Hash) -- The complete object as a Ruby hash
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 '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 'AuthenticationRole'
      @authentication_role = Comet::AuthenticationRoleOptions.new
      @authentication_role.from_hash(v)
    when 'Branding'
      @branding = Comet::BrandingOptions.new
      @branding.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 'Email'
      @email = Comet::EmailOptions.new
      @email.from_hash(v)
    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 '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 'IPRateLimit'
      @iprate_limit = Comet::RatelimitOptions.new
      @iprate_limit.from_hash(v)
    when 'License'
      @license = Comet::LicenseOptions.new
      @license.from_hash(v)
    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 '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 'PSAConfigs'
      if v.nil?
        @psaconfigs = []
      else
        @psaconfigs = Array.new(v.length)
        v.each_with_index do |v1, i1|
          @psaconfigs[i1] = Comet::PSAConfig.new
          @psaconfigs[i1].from_hash(v1)
        end
      end
    when 'SelfBackup'
      @self_backup = Comet::SelfBackupOptions.new
      @self_backup.from_hash(v)
    when 'SessionSettings'
      @session_settings = Comet::SessionOptions.new
      @session_settings.from_hash(v)
    when 'SoftwareBuildRole'
      @software_build_role = Comet::SoftwareBuildRoleOptions.new
      @software_build_role.from_hash(v)
    when 'StorageRole'
      @storage_role = Comet::StorageRoleOptions.new
      @storage_role.from_hash(v)
    when 'TrustXForwardedFor'
      @trust_xforwarded_for = v
    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 'AuditFileOptions'
      @audit_file_options = {}
      if v.nil?
        @audit_file_options = {}
      else
        v.each do |k1, v1|
          @audit_file_options[k1] = Comet::FileOption.new
          @audit_file_options[k1].from_hash(v1)
        end
      end
    else
      @unknown_json_fields[k] = v
    end
  end
end

def from_json(json_string)

Parameters:
  • json_string (String) -- The complete object in JSON format
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

def initialize

def initialize
  clear
end

def to_h

Returns:
  • (Hash) - The complete object as a Ruby hash
def to_h
  to_hash
end

def to_hash

Returns:
  • (Hash) - The complete object as a Ruby hash
def to_hash
  ret = {}
  ret['AdminUsers'] = @admin_users
  ret['AuthenticationRole'] = @authentication_role
  ret['Branding'] = @branding
  ret['ConstellationRole'] = @constellation_role
  unless @constellation_role__legacy.nil?
    ret['OverseerRole'] = @constellation_role__legacy
  end
  ret['Email'] = @email
  unless @experimental_options.nil?
    ret['ExperimentalOptions'] = @experimental_options
  end
  ret['ExternalAdminUserSources'] = @external_admin_user_sources
  ret['IPRateLimit'] = @iprate_limit
  ret['License'] = @license
  ret['ListenAddresses'] = @listen_addresses
  ret['Organizations'] = @organizations
  ret['PSAConfigs'] = @psaconfigs
  ret['SelfBackup'] = @self_backup
  ret['SessionSettings'] = @session_settings
  ret['SoftwareBuildRole'] = @software_build_role
  ret['StorageRole'] = @storage_role
  ret['TrustXForwardedFor'] = @trust_xforwarded_for
  ret['WebhookOptions'] = @webhook_options
  ret['AuditFileOptions'] = @audit_file_options
  @unknown_json_fields.each do |k, v|
    ret[k] = v
  end
  ret
end

def to_json(options = {})

Returns:
  • (String) - The complete object as a JSON string
def to_json(options = {})
  to_hash.to_json(options)
end