Class: Hook0::Generated::InstanceConfigFormbricks

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

Overview

The InstanceConfigFormbricks the API declares.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_host:, environment_id:) ⇒ InstanceConfigFormbricks

Returns a new instance of InstanceConfigFormbricks.

Parameters:

  • api_host (String)

    carries api_host.

  • environment_id (String)

    carries environment_id.



1361
1362
1363
1364
1365
# File 'lib/hook0/generated/models.rb', line 1361

def initialize(api_host:, environment_id:)
  @api_host = api_host
  @environment_id = environment_id
  freeze
end

Instance Attribute Details

#api_hostObject (readonly)

Returns the value of attribute api_host.



1356
1357
1358
# File 'lib/hook0/generated/models.rb', line 1356

def api_host
  @api_host
end

#environment_idObject (readonly)

Returns the value of attribute environment_id.



1356
1357
1358
# File 'lib/hook0/generated/models.rb', line 1356

def environment_id
  @environment_id
end

Class Method Details

.from_json(value) ⇒ InstanceConfigFormbricks

Read one out of what the API answered.

Parameters:

  • value (Object)

    the JSON document the API answered

Returns:



1371
1372
1373
1374
1375
1376
1377
# File 'lib/hook0/generated/models.rb', line 1371

def self.from_json(value)
  fields = Runtime.as_fields(value, "InstanceConfigFormbricks")
  new(
    api_host: Runtime.read(fields, "api_host", Runtime::TEXT),
    environment_id: Runtime.read(fields, "environment_id", Runtime::TEXT)
  )
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)


1393
1394
1395
# File 'lib/hook0/generated/models.rb', line 1393

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

#hashInteger

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

Returns:

  • (Integer)


1401
1402
1403
# File 'lib/hook0/generated/models.rb', line 1401

def hash
  to_h.hash
end

#to_hHash{String => Object}

Write one back the way the API reads it.

Returns:

  • (Hash{String => Object})


1382
1383
1384
1385
1386
1387
# File 'lib/hook0/generated/models.rb', line 1382

def to_h
  out = {}
  out["api_host"] = @api_host
  out["environment_id"] = @environment_id
  out
end