Class: GetStream::Generated::Models::BudgetStatusResponse
- Defined in:
- lib/getstream_ruby/generated/models/budget_status_response.rb
Instance Attribute Summary collapse
-
#enforced ⇒ Boolean
Whether exhausting the budget rejects requests with HTTP 429.
-
#limit_ms ⇒ Integer
Database time in milliseconds the endpoint may use per sliding window.
-
#remaining_ms ⇒ Integer
Database time in milliseconds left in the current sliding window, never negative.
-
#reset ⇒ Integer
The Unix timestamp at which all usage currently in the window will have expired, if no new usage is added.
-
#used_ms ⇒ Integer
Database time in milliseconds used in the current sliding window, including requests still in flight.
-
#window_seconds ⇒ Integer
Length of the sliding window in seconds.
Class Method Summary collapse
-
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ BudgetStatusResponse
constructor
Initialize with attributes.
Methods inherited from BaseModel
#==, #inspect, omit_empty_fields, #to_h, #to_json
Constructor Details
#initialize(attributes = {}) ⇒ BudgetStatusResponse
Initialize with attributes
32 33 34 35 36 37 38 39 40 |
# File 'lib/getstream_ruby/generated/models/budget_status_response.rb', line 32 def initialize(attributes = {}) super(attributes) @enforced = attributes.fetch(:enforced) { attributes.fetch('enforced', nil) } @limit_ms = attributes.fetch(:limit_ms) { attributes.fetch('limit_ms', nil) } @remaining_ms = attributes.fetch(:remaining_ms) { attributes.fetch('remaining_ms', nil) } @reset = attributes.fetch(:reset) { attributes.fetch('reset', nil) } @used_ms = attributes.fetch(:used_ms) { attributes.fetch('used_ms', nil) } @window_seconds = attributes.fetch(:window_seconds) { attributes.fetch('window_seconds', nil) } end |
Instance Attribute Details
#enforced ⇒ Boolean
Returns Whether exhausting the budget rejects requests with HTTP 429. False when the budget is only measured, or while enforcement is temporarily suspended.
14 15 16 |
# File 'lib/getstream_ruby/generated/models/budget_status_response.rb', line 14 def enforced @enforced end |
#limit_ms ⇒ Integer
Returns Database time in milliseconds the endpoint may use per sliding window.
17 18 19 |
# File 'lib/getstream_ruby/generated/models/budget_status_response.rb', line 17 def limit_ms @limit_ms end |
#remaining_ms ⇒ Integer
Returns Database time in milliseconds left in the current sliding window, never negative.
20 21 22 |
# File 'lib/getstream_ruby/generated/models/budget_status_response.rb', line 20 def remaining_ms @remaining_ms end |
#reset ⇒ Integer
Returns The Unix timestamp at which all usage currently in the window will have expired, if no new usage is added. The current time when no usage is recorded in the window. Can be in the future while used_ms is 0, when earlier usage was refunded.
23 24 25 |
# File 'lib/getstream_ruby/generated/models/budget_status_response.rb', line 23 def reset @reset end |
#used_ms ⇒ Integer
Returns Database time in milliseconds used in the current sliding window, including requests still in flight.
26 27 28 |
# File 'lib/getstream_ruby/generated/models/budget_status_response.rb', line 26 def used_ms @used_ms end |
#window_seconds ⇒ Integer
Returns Length of the sliding window in seconds.
29 30 31 |
# File 'lib/getstream_ruby/generated/models/budget_status_response.rb', line 29 def window_seconds @window_seconds end |
Class Method Details
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/getstream_ruby/generated/models/budget_status_response.rb', line 43 def self.json_field_mappings { enforced: 'enforced', limit_ms: 'limit_ms', remaining_ms: 'remaining_ms', reset: 'reset', used_ms: 'used_ms', window_seconds: 'window_seconds' } end |