Class: Hook0::Generated::RequestAttemptEvent
- Inherits:
-
Object
- Object
- Hook0::Generated::RequestAttemptEvent
- Defined in:
- lib/hook0/generated/models.rb
Overview
The RequestAttemptEvent the API declares.
Instance Attribute Summary collapse
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#event_type_name ⇒ Object
readonly
Returns the value of attribute event_type_name.
Class Method Summary collapse
-
.from_json(value) ⇒ RequestAttemptEvent
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(event_id:, event_type_name:) ⇒ RequestAttemptEvent
constructor
A new instance of RequestAttemptEvent.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(event_id:, event_type_name:) ⇒ RequestAttemptEvent
Returns a new instance of RequestAttemptEvent.
2378 2379 2380 2381 2382 |
# File 'lib/hook0/generated/models.rb', line 2378 def initialize(event_id:, event_type_name:) @event_id = event_id @event_type_name = event_type_name freeze end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
2373 2374 2375 |
# File 'lib/hook0/generated/models.rb', line 2373 def event_id @event_id end |
#event_type_name ⇒ Object (readonly)
Returns the value of attribute event_type_name.
2373 2374 2375 |
# File 'lib/hook0/generated/models.rb', line 2373 def event_type_name @event_type_name end |
Class Method Details
.from_json(value) ⇒ RequestAttemptEvent
Read one out of what the API answered.
2388 2389 2390 2391 2392 2393 2394 |
# File 'lib/hook0/generated/models.rb', line 2388 def self.from_json(value) fields = Runtime.as_fields(value, "RequestAttemptEvent") new( event_id: Runtime.read(fields, "event_id", Runtime::UUID), event_type_name: Runtime.read(fields, "event_type_name", Runtime::TEXT) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
2410 2411 2412 |
# File 'lib/hook0/generated/models.rb', line 2410 def ==(other) other.is_a?(RequestAttemptEvent) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
2418 2419 2420 |
# File 'lib/hook0/generated/models.rb', line 2418 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
2399 2400 2401 2402 2403 2404 |
# File 'lib/hook0/generated/models.rb', line 2399 def to_h out = {} out["event_id"] = @event_id out["event_type_name"] = @event_type_name out end |