class Comet::ServerConfigOptions

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