Class: Hook0::Generated::QuotasResponse

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

Overview

The QuotasResponse the API declares.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled:, limits:) ⇒ QuotasResponse

Returns a new instance of QuotasResponse.

Parameters:



2055
2056
2057
2058
2059
# File 'lib/hook0/generated/models.rb', line 2055

def initialize(enabled:, limits:)
  @enabled = enabled
  @limits = limits
  freeze
end

Instance Attribute Details

#enabledObject (readonly)

Returns the value of attribute enabled.



2050
2051
2052
# File 'lib/hook0/generated/models.rb', line 2050

def enabled
  @enabled
end

#limitsObject (readonly)

Returns the value of attribute limits.



2050
2051
2052
# File 'lib/hook0/generated/models.rb', line 2050

def limits
  @limits
end

Class Method Details

.from_json(value) ⇒ QuotasResponse

Read one out of what the API answered.

Parameters:

  • value (Object)

    the JSON document the API answered

Returns:



2065
2066
2067
2068
2069
2070
2071
# File 'lib/hook0/generated/models.rb', line 2065

def self.from_json(value)
  fields = Runtime.as_fields(value, "QuotasResponse")
  new(
    enabled: Runtime.read(fields, "enabled", Runtime::BOOLEAN),
    limits: Runtime.read(fields, "limits", QuotasResponseLimits.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)


2087
2088
2089
# File 'lib/hook0/generated/models.rb', line 2087

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

#hashInteger

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

Returns:

  • (Integer)


2095
2096
2097
# File 'lib/hook0/generated/models.rb', line 2095

def hash
  to_h.hash
end

#to_hHash{String => Object}

Write one back the way the API reads it.

Returns:

  • (Hash{String => Object})


2076
2077
2078
2079
2080
2081
# File 'lib/hook0/generated/models.rb', line 2076

def to_h
  out = {}
  out["enabled"] = @enabled
  out["limits"] = @limits.to_h
  out
end