Class: Twilio::REST::Lookups::V2::BucketInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Lookups::V2::BucketInstance
- Defined in:
- lib/twilio-ruby/rest/lookups/v2/bucket.rb
Instance Method Summary collapse
-
#bucket ⇒ String
Name of the bucket.
-
#code ⇒ String
Twilio-specific error code.
-
#context ⇒ BucketContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#delete ⇒ Boolean
Delete the BucketInstance.
-
#fetch ⇒ BucketInstance
Fetch the BucketInstance.
-
#field ⇒ String
Limit of requests for the bucket.
-
#initialize(version, payload, field: nil, bucket: nil) ⇒ BucketInstance
constructor
Initialize the BucketInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#limit ⇒ String
Limit of requests for the bucket.
-
#message ⇒ String
Error message.
-
#more_info ⇒ String
Link to Error Code References.
-
#owner ⇒ String
Owner of the rule.
-
#status ⇒ String
HTTP response status code.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#ttl ⇒ String
Time to live of the rule.
-
#update(rate_limit_request: :unset) ⇒ BucketInstance
Update the BucketInstance.
Constructor Details
#initialize(version, payload, field: nil, bucket: nil) ⇒ BucketInstance
Initialize the BucketInstance
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 184 def initialize(version, payload , field: nil, bucket: nil) super(version) # Marshaled Properties @properties = { 'code' => payload['code'], 'message' => payload['message'], 'more_info' => payload['more_info'], 'status' => payload['status'], 'field' => payload['field'], 'limit' => payload['limit'], 'bucket' => payload['bucket'], 'owner' => payload['owner'], 'ttl' => payload['ttl'], } # Context @instance_context = nil @params = { 'field' => field || @properties['field'] ,'bucket' => bucket || @properties['bucket'] , } end |
Instance Method Details
#bucket ⇒ String
Returns Name of the bucket.
254 255 256 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 254 def bucket @properties['bucket'] end |
#code ⇒ String
Returns Twilio-specific error code.
218 219 220 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 218 def code @properties['code'] end |
#context ⇒ BucketContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
209 210 211 212 213 214 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 209 def context unless @instance_context @instance_context = BucketContext.new(@version , @params['field'], @params['bucket']) end @instance_context end |
#delete ⇒ Boolean
Delete the BucketInstance
273 274 275 276 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 273 def delete context.delete end |
#fetch ⇒ BucketInstance
Fetch the BucketInstance
281 282 283 284 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 281 def fetch context.fetch end |
#field ⇒ String
Returns Limit of requests for the bucket.
242 243 244 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 242 def field @properties['field'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
306 307 308 309 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 306 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Lookups.V2.BucketInstance #{values}>" end |
#limit ⇒ String
Returns Limit of requests for the bucket.
248 249 250 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 248 def limit @properties['limit'] end |
#message ⇒ String
Returns Error message.
224 225 226 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 224 def @properties['message'] end |
#more_info ⇒ String
Returns Link to Error Code References.
230 231 232 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 230 def more_info @properties['more_info'] end |
#owner ⇒ String
Returns Owner of the rule.
260 261 262 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 260 def owner @properties['owner'] end |
#status ⇒ String
Returns HTTP response status code.
236 237 238 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 236 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
299 300 301 302 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 299 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Lookups.V2.BucketInstance #{values}>" end |
#ttl ⇒ String
Returns Time to live of the rule.
266 267 268 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 266 def ttl @properties['ttl'] end |
#update(rate_limit_request: :unset) ⇒ BucketInstance
Update the BucketInstance
290 291 292 293 294 295 |
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 290 def update(rate_limit_request: :unset ) context.update( ) end |