lib/fastly/models/rate_limiter_response.rb in fastly-5.2.2 vs lib/fastly/models/rate_limiter_response.rb in fastly-5.3.0
- old
+ new
@@ -35,10 +35,11 @@
attr_accessor :penalty_box_duration
# The action to take when a rate limiter violation is detected.
attr_accessor :action
+ # Custom response to be sent when the rate limit is exceeded. Required if `action` is `response`.
attr_accessor :response
# Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration.
attr_accessor :response_object_name
@@ -124,11 +125,11 @@
:'rps_limit' => :'Integer',
:'window_size' => :'Integer',
:'client_key' => :'Array<String>',
:'penalty_box_duration' => :'Integer',
:'action' => :'String',
- :'response' => :'RateLimiterResponse1',
+ :'response' => :'Hash<String, String>',
:'response_object_name' => :'String',
:'logger_type' => :'String',
:'feature_revision' => :'Integer',
:'service_id' => :'String',
:'version' => :'Integer',
@@ -211,10 +212,12 @@
if attributes.key?(:'action')
self.action = attributes[:'action']
end
if attributes.key?(:'response')
- self.response = attributes[:'response']
+ if (value = attributes[:'response']).is_a?(Hash)
+ self.response = value
+ end
end
if attributes.key?(:'response_object_name')
self.response_object_name = attributes[:'response_object_name']
end