Class: Hook0::Generated::OrganizationInfo
- Inherits:
-
Object
- Object
- Hook0::Generated::OrganizationInfo
- Defined in:
- lib/hook0/generated/models.rb
Overview
The OrganizationInfo the API declares.
Instance Attribute Summary collapse
-
#consumption ⇒ Object
readonly
Returns the value of attribute consumption.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#onboarding_steps ⇒ Object
readonly
Returns the value of attribute onboarding_steps.
-
#organization_id ⇒ Object
readonly
Returns the value of attribute organization_id.
-
#plan ⇒ Object
readonly
Returns the value of attribute plan.
-
#quotas ⇒ Object
readonly
Returns the value of attribute quotas.
-
#users ⇒ Object
readonly
Returns the value of attribute users.
Class Method Summary collapse
-
.from_json(value) ⇒ OrganizationInfo
Read one out of what the API answered.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
(also: #eql?)
Whether that value carries the same members as this one.
-
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
-
#initialize(consumption:, name:, onboarding_steps:, organization_id:, quotas:, users:, plan: nil) ⇒ OrganizationInfo
constructor
A new instance of OrganizationInfo.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(consumption:, name:, onboarding_steps:, organization_id:, quotas:, users:, plan: nil) ⇒ OrganizationInfo
Returns a new instance of OrganizationInfo.
1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 |
# File 'lib/hook0/generated/models.rb', line 1537 def initialize(consumption:, name:, onboarding_steps:, organization_id:, quotas:, users:, plan: nil) @consumption = consumption @name = name @onboarding_steps = onboarding_steps @organization_id = organization_id @quotas = quotas @users = users @plan = plan freeze end |
Instance Attribute Details
#consumption ⇒ Object (readonly)
Returns the value of attribute consumption.
1522 1523 1524 |
# File 'lib/hook0/generated/models.rb', line 1522 def consumption @consumption end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
1522 1523 1524 |
# File 'lib/hook0/generated/models.rb', line 1522 def name @name end |
#onboarding_steps ⇒ Object (readonly)
Returns the value of attribute onboarding_steps.
1522 1523 1524 |
# File 'lib/hook0/generated/models.rb', line 1522 def onboarding_steps @onboarding_steps end |
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
1522 1523 1524 |
# File 'lib/hook0/generated/models.rb', line 1522 def organization_id @organization_id end |
#plan ⇒ Object (readonly)
Returns the value of attribute plan.
1522 1523 1524 |
# File 'lib/hook0/generated/models.rb', line 1522 def plan @plan end |
#quotas ⇒ Object (readonly)
Returns the value of attribute quotas.
1522 1523 1524 |
# File 'lib/hook0/generated/models.rb', line 1522 def quotas @quotas end |
#users ⇒ Object (readonly)
Returns the value of attribute users.
1522 1523 1524 |
# File 'lib/hook0/generated/models.rb', line 1522 def users @users end |
Class Method Details
.from_json(value) ⇒ OrganizationInfo
Read one out of what the API answered.
1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 |
# File 'lib/hook0/generated/models.rb', line 1552 def self.from_json(value) fields = Runtime.as_fields(value, "OrganizationInfo") new( consumption: Runtime.read(fields, "consumption", OrganizationInfoConsumption.method(:from_json)), name: Runtime.read(fields, "name", Runtime::TEXT), onboarding_steps: Runtime.read( fields, "onboarding_steps", OrganizationInfoOnboardingSteps.method(:from_json) ), organization_id: Runtime.read(fields, "organization_id", Runtime::UUID), quotas: Runtime.read(fields, "quotas", OrganizationInfoQuotas.method(:from_json)), users: Runtime.read(fields, "users", Runtime.list(OrganizationInfoUsers.method(:from_json))), plan: Runtime.maybe(fields, "plan", OrganizationInfoPlan.method(:from_json)) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
1588 1589 1590 |
# File 'lib/hook0/generated/models.rb', line 1588 def ==(other) other.is_a?(OrganizationInfo) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
1596 1597 1598 |
# File 'lib/hook0/generated/models.rb', line 1596 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 |
# File 'lib/hook0/generated/models.rb', line 1572 def to_h out = {} out["consumption"] = @consumption.to_h out["name"] = @name out["onboarding_steps"] = @onboarding_steps.to_h out["organization_id"] = @organization_id out["quotas"] = @quotas.to_h out["users"] = @users.map(&:to_h) out["plan"] = @plan.to_h unless @plan.nil? out end |