Class: Hook0::Generated::ServiceTokenPost
- Inherits:
-
Object
- Object
- Hook0::Generated::ServiceTokenPost
- Defined in:
- lib/hook0/generated/models.rb
Overview
The ServiceTokenPost the API declares.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#organization_id ⇒ Object
readonly
Returns the value of attribute organization_id.
Class Method Summary collapse
-
.from_json(value) ⇒ ServiceTokenPost
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(name:, organization_id:) ⇒ ServiceTokenPost
constructor
A new instance of ServiceTokenPost.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(name:, organization_id:) ⇒ ServiceTokenPost
Returns a new instance of ServiceTokenPost.
2693 2694 2695 2696 2697 |
# File 'lib/hook0/generated/models.rb', line 2693 def initialize(name:, organization_id:) @name = name @organization_id = organization_id freeze end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
2688 2689 2690 |
# File 'lib/hook0/generated/models.rb', line 2688 def name @name end |
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
2688 2689 2690 |
# File 'lib/hook0/generated/models.rb', line 2688 def organization_id @organization_id end |
Class Method Details
.from_json(value) ⇒ ServiceTokenPost
Read one out of what the API answered.
2703 2704 2705 2706 2707 2708 2709 |
# File 'lib/hook0/generated/models.rb', line 2703 def self.from_json(value) fields = Runtime.as_fields(value, "ServiceTokenPost") new( name: Runtime.read(fields, "name", Runtime::TEXT), organization_id: Runtime.read(fields, "organization_id", Runtime::UUID) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
2725 2726 2727 |
# File 'lib/hook0/generated/models.rb', line 2725 def ==(other) other.is_a?(ServiceTokenPost) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
2733 2734 2735 |
# File 'lib/hook0/generated/models.rb', line 2733 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
2714 2715 2716 2717 2718 2719 |
# File 'lib/hook0/generated/models.rb', line 2714 def to_h out = {} out["name"] = @name out["organization_id"] = @organization_id out end |