Class: Hook0::Generated::ApplicationInfoQuotas

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

Overview

The ApplicationInfoQuotas the API declares.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(days_of_events_retention_limit:, events_per_day_limit:) ⇒ ApplicationInfoQuotas

Returns a new instance of ApplicationInfoQuotas.

Parameters:

  • days_of_events_retention_limit (Integer)

    carries days_of_events_retention_limit.

  • events_per_day_limit (Integer)

    carries events_per_day_limit.



507
508
509
510
511
# File 'lib/hook0/generated/models.rb', line 507

def initialize(days_of_events_retention_limit:, events_per_day_limit:)
  @days_of_events_retention_limit = days_of_events_retention_limit
  @events_per_day_limit = events_per_day_limit
  freeze
end

Instance Attribute Details

#days_of_events_retention_limitObject (readonly)

Returns the value of attribute days_of_events_retention_limit.



502
503
504
# File 'lib/hook0/generated/models.rb', line 502

def days_of_events_retention_limit
  @days_of_events_retention_limit
end

#events_per_day_limitObject (readonly)

Returns the value of attribute events_per_day_limit.



502
503
504
# File 'lib/hook0/generated/models.rb', line 502

def events_per_day_limit
  @events_per_day_limit
end

Class Method Details

.from_json(value) ⇒ ApplicationInfoQuotas

Read one out of what the API answered.

Parameters:

  • value (Object)

    the JSON document the API answered

Returns:



517
518
519
520
521
522
523
# File 'lib/hook0/generated/models.rb', line 517

def self.from_json(value)
  fields = Runtime.as_fields(value, "ApplicationInfoQuotas")
  new(
    days_of_events_retention_limit: Runtime.read(fields, "days_of_events_retention_limit", Runtime::INTEGER),
    events_per_day_limit: Runtime.read(fields, "events_per_day_limit", Runtime::INTEGER)
  )
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)


539
540
541
# File 'lib/hook0/generated/models.rb', line 539

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

#hashInteger

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

Returns:

  • (Integer)


547
548
549
# File 'lib/hook0/generated/models.rb', line 547

def hash
  to_h.hash
end

#to_hHash{String => Object}

Write one back the way the API reads it.

Returns:

  • (Hash{String => Object})


528
529
530
531
532
533
# File 'lib/hook0/generated/models.rb', line 528

def to_h
  out = {}
  out["days_of_events_retention_limit"] = @days_of_events_retention_limit
  out["events_per_day_limit"] = @events_per_day_limit
  out
end