Class: Hook0::Generated::RequestAttemptSubscription
- Inherits:
-
Object
- Object
- Hook0::Generated::RequestAttemptSubscription
- Defined in:
- lib/hook0/generated/models.rb
Overview
The RequestAttemptSubscription the API declares.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#subscription_id ⇒ Object
readonly
Returns the value of attribute subscription_id.
Class Method Summary collapse
-
.from_json(value) ⇒ RequestAttemptSubscription
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(subscription_id:, description: nil) ⇒ RequestAttemptSubscription
constructor
A new instance of RequestAttemptSubscription.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(subscription_id:, description: nil) ⇒ RequestAttemptSubscription
Returns a new instance of RequestAttemptSubscription.
2500 2501 2502 2503 2504 |
# File 'lib/hook0/generated/models.rb', line 2500 def initialize(subscription_id:, description: nil) @subscription_id = subscription_id @description = description freeze end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
2495 2496 2497 |
# File 'lib/hook0/generated/models.rb', line 2495 def description @description end |
#subscription_id ⇒ Object (readonly)
Returns the value of attribute subscription_id.
2495 2496 2497 |
# File 'lib/hook0/generated/models.rb', line 2495 def subscription_id @subscription_id end |
Class Method Details
.from_json(value) ⇒ RequestAttemptSubscription
Read one out of what the API answered.
2510 2511 2512 2513 2514 2515 2516 |
# File 'lib/hook0/generated/models.rb', line 2510 def self.from_json(value) fields = Runtime.as_fields(value, "RequestAttemptSubscription") new( subscription_id: Runtime.read(fields, "subscription_id", Runtime::UUID), description: Runtime.maybe(fields, "description", Runtime::TEXT) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
2532 2533 2534 |
# File 'lib/hook0/generated/models.rb', line 2532 def ==(other) other.is_a?(RequestAttemptSubscription) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
2540 2541 2542 |
# File 'lib/hook0/generated/models.rb', line 2540 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
2521 2522 2523 2524 2525 2526 |
# File 'lib/hook0/generated/models.rb', line 2521 def to_h out = {} out["subscription_id"] = @subscription_id out["description"] = @description unless @description.nil? out end |