Class: Hook0::Generated::InstanceConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/hook0/generated/models.rb

Overview

The InstanceConfig the API declares.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application_secret_compatibility:, auto_db_migration:, biscuit_public_key:, password_minimum_length:, quota_enforcement:, registration_disabled:, support_email_address:, cloudflare_turnstile_site_key: nil, formbricks: nil, matomo: nil) ⇒ InstanceConfig

Returns a new instance of InstanceConfig.

Parameters:

  • application_secret_compatibility (Boolean)

    carries application_secret_compatibility.

  • auto_db_migration (Boolean)

    carries auto_db_migration.

  • biscuit_public_key (String)

    carries biscuit_public_key.

  • password_minimum_length (Integer)

    carries password_minimum_length.

  • quota_enforcement (Boolean)

    carries quota_enforcement.

  • registration_disabled (Boolean)

    carries registration_disabled.

  • support_email_address (String)

    carries support_email_address.

  • cloudflare_turnstile_site_key (String, nil) (defaults to: nil)

    carries cloudflare_turnstile_site_key.

  • formbricks (InstanceConfigFormbricks, nil) (defaults to: nil)

    carries formbricks.

  • matomo (InstanceConfigMatomo, nil) (defaults to: nil)

    carries matomo.



1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
# File 'lib/hook0/generated/models.rb', line 1274

def initialize(
  application_secret_compatibility:,
  auto_db_migration:,
  biscuit_public_key:,
  password_minimum_length:,
  quota_enforcement:,
  registration_disabled:,
  support_email_address:,
  cloudflare_turnstile_site_key: nil,
  formbricks: nil,
  matomo: nil
)
  @application_secret_compatibility = application_secret_compatibility
  @auto_db_migration = auto_db_migration
  @biscuit_public_key = biscuit_public_key
  @password_minimum_length = password_minimum_length
  @quota_enforcement = quota_enforcement
  @registration_disabled = registration_disabled
  @support_email_address = support_email_address
  @cloudflare_turnstile_site_key = cloudflare_turnstile_site_key
  @formbricks = formbricks
  @matomo = matomo
  freeze
end

Instance Attribute Details

#application_secret_compatibilityObject (readonly)

Returns the value of attribute application_secret_compatibility.



1253
1254
1255
# File 'lib/hook0/generated/models.rb', line 1253

def application_secret_compatibility
  @application_secret_compatibility
end

#auto_db_migrationObject (readonly)

Returns the value of attribute auto_db_migration.



1253
1254
1255
# File 'lib/hook0/generated/models.rb', line 1253

def auto_db_migration
  @auto_db_migration
end

#biscuit_public_keyObject (readonly)

Returns the value of attribute biscuit_public_key.



1253
1254
1255
# File 'lib/hook0/generated/models.rb', line 1253

def biscuit_public_key
  @biscuit_public_key
end

#cloudflare_turnstile_site_keyObject (readonly)

Returns the value of attribute cloudflare_turnstile_site_key.



1253
1254
1255
# File 'lib/hook0/generated/models.rb', line 1253

def cloudflare_turnstile_site_key
  @cloudflare_turnstile_site_key
end

#formbricksObject (readonly)

Returns the value of attribute formbricks.



1253
1254
1255
# File 'lib/hook0/generated/models.rb', line 1253

def formbricks
  @formbricks
end

#matomoObject (readonly)

Returns the value of attribute matomo.



1253
1254
1255
# File 'lib/hook0/generated/models.rb', line 1253

def matomo
  @matomo
end

#password_minimum_lengthObject (readonly)

Returns the value of attribute password_minimum_length.



1253
1254
1255
# File 'lib/hook0/generated/models.rb', line 1253

def password_minimum_length
  @password_minimum_length
end

#quota_enforcementObject (readonly)

Returns the value of attribute quota_enforcement.



1253
1254
1255
# File 'lib/hook0/generated/models.rb', line 1253

def quota_enforcement
  @quota_enforcement
end

#registration_disabledObject (readonly)

Returns the value of attribute registration_disabled.



1253
1254
1255
# File 'lib/hook0/generated/models.rb', line 1253

def registration_disabled
  @registration_disabled
end

#support_email_addressObject (readonly)

Returns the value of attribute support_email_address.



1253
1254
1255
# File 'lib/hook0/generated/models.rb', line 1253

def support_email_address
  @support_email_address
end

Class Method Details

.from_json(value) ⇒ InstanceConfig

Read one out of what the API answered.

Parameters:

  • value (Object)

    the JSON document the API answered

Returns:



1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
# File 'lib/hook0/generated/models.rb', line 1303

def self.from_json(value)
  fields = Runtime.as_fields(value, "InstanceConfig")
  new(
    application_secret_compatibility: Runtime.read(fields, "application_secret_compatibility", Runtime::BOOLEAN),
    auto_db_migration: Runtime.read(fields, "auto_db_migration", Runtime::BOOLEAN),
    biscuit_public_key: Runtime.read(fields, "biscuit_public_key", Runtime::TEXT),
    password_minimum_length: Runtime.read(fields, "password_minimum_length", Runtime::INTEGER),
    quota_enforcement: Runtime.read(fields, "quota_enforcement", Runtime::BOOLEAN),
    registration_disabled: Runtime.read(fields, "registration_disabled", Runtime::BOOLEAN),
    support_email_address: Runtime.read(fields, "support_email_address", Runtime::TEXT),
    cloudflare_turnstile_site_key: Runtime.maybe(fields, "cloudflare_turnstile_site_key", Runtime::TEXT),
    formbricks: Runtime.maybe(fields, "formbricks", InstanceConfigFormbricks.method(:from_json)),
    matomo: Runtime.maybe(fields, "matomo", InstanceConfigMatomo.method(:from_json))
  )
end

Instance Method Details

#==(other) ⇒ Boolean Also known as: eql?

Whether that value carries the same members as this one.

Parameters:

  • other (Object)

Returns:

  • (Boolean)


1341
1342
1343
# File 'lib/hook0/generated/models.rb', line 1341

def ==(other)
  other.is_a?(InstanceConfig) && to_h == other.to_h
end

#hashInteger

A value two equal instances share, so that either may key a hash.

Returns:

  • (Integer)


1349
1350
1351
# File 'lib/hook0/generated/models.rb', line 1349

def hash
  to_h.hash
end

#to_hHash{String => Object}

Write one back the way the API reads it.

Returns:

  • (Hash{String => Object})


1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
# File 'lib/hook0/generated/models.rb', line 1322

def to_h
  out = {}
  out["application_secret_compatibility"] = @application_secret_compatibility
  out["auto_db_migration"] = @auto_db_migration
  out["biscuit_public_key"] = @biscuit_public_key
  out["password_minimum_length"] = @password_minimum_length
  out["quota_enforcement"] = @quota_enforcement
  out["registration_disabled"] = @registration_disabled
  out["support_email_address"] = @support_email_address
  out["cloudflare_turnstile_site_key"] = @cloudflare_turnstile_site_key unless @cloudflare_turnstile_site_key.nil?
  out["formbricks"] = @formbricks.to_h unless @formbricks.nil?
  out["matomo"] = @matomo.to_h unless @matomo.nil?
  out
end