Class: Hook0::Generated::RequestAttemptStatus
- Inherits:
-
Object
- Object
- Hook0::Generated::RequestAttemptStatus
- Defined in:
- lib/hook0/generated/models.rb
Overview
The RequestAttemptStatus the API declares.
Instance Attribute Summary collapse
-
#at ⇒ Object
readonly
Returns the value of attribute at.
-
#full_processing_ms ⇒ Object
readonly
Returns the value of attribute full_processing_ms.
-
#since ⇒ Object
readonly
Returns the value of attribute since.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#until_ ⇒ Object
readonly
Returns the value of attribute until_.
Class Method Summary collapse
-
.from_json(value) ⇒ RequestAttemptStatus
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(type:, at: nil, full_processing_ms: nil, since: nil, until_: nil) ⇒ RequestAttemptStatus
constructor
A new instance of RequestAttemptStatus.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(type:, at: nil, full_processing_ms: nil, since: nil, until_: nil) ⇒ RequestAttemptStatus
Returns a new instance of RequestAttemptStatus.
2439 2440 2441 2442 2443 2444 2445 2446 |
# File 'lib/hook0/generated/models.rb', line 2439 def initialize(type:, at: nil, full_processing_ms: nil, since: nil, until_: nil) @type = type @at = at @full_processing_ms = full_processing_ms @since = since @until_ = until_ freeze end |
Instance Attribute Details
#at ⇒ Object (readonly)
Returns the value of attribute at.
2425 2426 2427 |
# File 'lib/hook0/generated/models.rb', line 2425 def at @at end |
#full_processing_ms ⇒ Object (readonly)
Returns the value of attribute full_processing_ms.
2425 2426 2427 |
# File 'lib/hook0/generated/models.rb', line 2425 def full_processing_ms @full_processing_ms end |
#since ⇒ Object (readonly)
Returns the value of attribute since.
2425 2426 2427 |
# File 'lib/hook0/generated/models.rb', line 2425 def since @since end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
2425 2426 2427 |
# File 'lib/hook0/generated/models.rb', line 2425 def type @type end |
#until_ ⇒ Object (readonly)
Returns the value of attribute until_.
2425 2426 2427 |
# File 'lib/hook0/generated/models.rb', line 2425 def until_ @until_ end |
Class Method Details
.from_json(value) ⇒ RequestAttemptStatus
Read one out of what the API answered.
2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 |
# File 'lib/hook0/generated/models.rb', line 2452 def self.from_json(value) fields = Runtime.as_fields(value, "RequestAttemptStatus") new( type: Runtime.read(fields, "type", Runtime.member_of(RequestAttemptStatusType)), at: Runtime.maybe(fields, "at", Runtime::DATE_TIME), full_processing_ms: Runtime.maybe(fields, "full_processing_ms", Runtime::INTEGER), since: Runtime.maybe(fields, "since", Runtime::DATE_TIME), until_: Runtime.maybe(fields, "until", Runtime::DATE_TIME) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
2480 2481 2482 |
# File 'lib/hook0/generated/models.rb', line 2480 def ==(other) other.is_a?(RequestAttemptStatus) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
2488 2489 2490 |
# File 'lib/hook0/generated/models.rb', line 2488 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
2466 2467 2468 2469 2470 2471 2472 2473 2474 |
# File 'lib/hook0/generated/models.rb', line 2466 def to_h out = {} out["type"] = @type out["at"] = Runtime.moment(@at) unless @at.nil? out["full_processing_ms"] = @full_processing_ms unless @full_processing_ms.nil? out["since"] = Runtime.moment(@since) unless @since.nil? out["until"] = Runtime.moment(@until_) unless @until_.nil? out end |