Class: Hook0::Generated::RequestAttempt
- Inherits:
-
Object
- Object
- Hook0::Generated::RequestAttempt
- Defined in:
- lib/hook0/generated/models.rb
Overview
The RequestAttempt the API declares.
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#delay_until ⇒ Object
readonly
Returns the value of attribute delay_until.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#failed_at ⇒ Object
readonly
Returns the value of attribute failed_at.
-
#http_response_status ⇒ Object
readonly
Returns the value of attribute http_response_status.
-
#picked_at ⇒ Object
readonly
Returns the value of attribute picked_at.
-
#request_attempt_id ⇒ Object
readonly
Returns the value of attribute request_attempt_id.
-
#response_id ⇒ Object
readonly
Returns the value of attribute response_id.
-
#retry_count ⇒ Object
readonly
Returns the value of attribute retry_count.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#subscription ⇒ Object
readonly
Returns the value of attribute subscription.
-
#succeeded_at ⇒ Object
readonly
Returns the value of attribute succeeded_at.
Class Method Summary collapse
-
.from_json(value) ⇒ RequestAttempt
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(created_at:, event:, event_id:, request_attempt_id:, retry_count:, status:, subscription:, delay_until: nil, failed_at: nil, http_response_status: nil, picked_at: nil, response_id: nil, succeeded_at: nil) ⇒ RequestAttempt
constructor
A new instance of RequestAttempt.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(created_at:, event:, event_id:, request_attempt_id:, retry_count:, status:, subscription:, delay_until: nil, failed_at: nil, http_response_status: nil, picked_at: nil, response_id: nil, succeeded_at: nil) ⇒ RequestAttempt
Returns a new instance of RequestAttempt.
2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 |
# File 'lib/hook0/generated/models.rb', line 2279 def initialize( created_at:, event:, event_id:, request_attempt_id:, retry_count:, status:, subscription:, delay_until: nil, failed_at: nil, http_response_status: nil, picked_at: nil, response_id: nil, succeeded_at: nil ) @created_at = created_at @event = event @event_id = event_id @request_attempt_id = request_attempt_id @retry_count = retry_count @status = status @subscription = subscription @delay_until = delay_until @failed_at = failed_at @http_response_status = http_response_status @picked_at = picked_at @response_id = response_id @succeeded_at = succeeded_at freeze end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
2250 2251 2252 |
# File 'lib/hook0/generated/models.rb', line 2250 def created_at @created_at end |
#delay_until ⇒ Object (readonly)
Returns the value of attribute delay_until.
2250 2251 2252 |
# File 'lib/hook0/generated/models.rb', line 2250 def delay_until @delay_until end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
2250 2251 2252 |
# File 'lib/hook0/generated/models.rb', line 2250 def event @event end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
2250 2251 2252 |
# File 'lib/hook0/generated/models.rb', line 2250 def event_id @event_id end |
#failed_at ⇒ Object (readonly)
Returns the value of attribute failed_at.
2250 2251 2252 |
# File 'lib/hook0/generated/models.rb', line 2250 def failed_at @failed_at end |
#http_response_status ⇒ Object (readonly)
Returns the value of attribute http_response_status.
2250 2251 2252 |
# File 'lib/hook0/generated/models.rb', line 2250 def http_response_status @http_response_status end |
#picked_at ⇒ Object (readonly)
Returns the value of attribute picked_at.
2250 2251 2252 |
# File 'lib/hook0/generated/models.rb', line 2250 def picked_at @picked_at end |
#request_attempt_id ⇒ Object (readonly)
Returns the value of attribute request_attempt_id.
2250 2251 2252 |
# File 'lib/hook0/generated/models.rb', line 2250 def request_attempt_id @request_attempt_id end |
#response_id ⇒ Object (readonly)
Returns the value of attribute response_id.
2250 2251 2252 |
# File 'lib/hook0/generated/models.rb', line 2250 def response_id @response_id end |
#retry_count ⇒ Object (readonly)
Returns the value of attribute retry_count.
2250 2251 2252 |
# File 'lib/hook0/generated/models.rb', line 2250 def retry_count @retry_count end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
2250 2251 2252 |
# File 'lib/hook0/generated/models.rb', line 2250 def status @status end |
#subscription ⇒ Object (readonly)
Returns the value of attribute subscription.
2250 2251 2252 |
# File 'lib/hook0/generated/models.rb', line 2250 def subscription @subscription end |
#succeeded_at ⇒ Object (readonly)
Returns the value of attribute succeeded_at.
2250 2251 2252 |
# File 'lib/hook0/generated/models.rb', line 2250 def succeeded_at @succeeded_at end |
Class Method Details
.from_json(value) ⇒ RequestAttempt
Read one out of what the API answered.
2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 |
# File 'lib/hook0/generated/models.rb', line 2314 def self.from_json(value) fields = Runtime.as_fields(value, "RequestAttempt") new( created_at: Runtime.read(fields, "created_at", Runtime::DATE_TIME), event: Runtime.read(fields, "event", RequestAttemptEvent.method(:from_json)), event_id: Runtime.read(fields, "event_id", Runtime::UUID), request_attempt_id: Runtime.read(fields, "request_attempt_id", Runtime::UUID), retry_count: Runtime.read(fields, "retry_count", Runtime::INTEGER), status: Runtime.read(fields, "status", RequestAttemptStatus.method(:from_json)), subscription: Runtime.read(fields, "subscription", RequestAttemptSubscription.method(:from_json)), delay_until: Runtime.maybe(fields, "delay_until", Runtime::DATE_TIME), failed_at: Runtime.maybe(fields, "failed_at", Runtime::DATE_TIME), http_response_status: Runtime.maybe(fields, "http_response_status", Runtime::INTEGER), picked_at: Runtime.maybe(fields, "picked_at", Runtime::DATE_TIME), response_id: Runtime.maybe(fields, "response_id", Runtime::UUID), succeeded_at: Runtime.maybe(fields, "succeeded_at", Runtime::DATE_TIME) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
2358 2359 2360 |
# File 'lib/hook0/generated/models.rb', line 2358 def ==(other) other.is_a?(RequestAttempt) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
2366 2367 2368 |
# File 'lib/hook0/generated/models.rb', line 2366 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 |
# File 'lib/hook0/generated/models.rb', line 2336 def to_h out = {} out["created_at"] = Runtime.moment(@created_at) out["event"] = @event.to_h out["event_id"] = @event_id out["request_attempt_id"] = @request_attempt_id out["retry_count"] = @retry_count out["status"] = @status.to_h out["subscription"] = @subscription.to_h out["delay_until"] = Runtime.moment(@delay_until) unless @delay_until.nil? out["failed_at"] = Runtime.moment(@failed_at) unless @failed_at.nil? out["http_response_status"] = @http_response_status unless @http_response_status.nil? out["picked_at"] = Runtime.moment(@picked_at) unless @picked_at.nil? out["response_id"] = @response_id unless @response_id.nil? out["succeeded_at"] = Runtime.moment(@succeeded_at) unless @succeeded_at.nil? out end |