Class: Twilio::REST::Verify::V2::ServiceContext::RateLimitInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Verify::V2::ServiceContext::RateLimitInstance
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#buckets ⇒ buckets
Access the buckets.
-
#context ⇒ RateLimitContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The RFC 2822 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The RFC 2822 date and time in GMT when the resource was last updated.
-
#delete ⇒ Boolean
Deletes the RateLimitInstance.
-
#description ⇒ String
Description of this Rate Limit.
-
#fetch ⇒ RateLimitInstance
Fetch a RateLimitInstance.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ RateLimitInstance
constructor
Initialize the RateLimitInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#service_sid ⇒ String
The SID of the Service that the resource is associated with.
-
#sid ⇒ String
A string that uniquely identifies this Rate Limit.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
A unique, developer assigned name of this Rate Limit.
-
#update(description: :unset) ⇒ RateLimitInstance
Update the RateLimitInstance.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ RateLimitInstance
Initialize the RateLimitInstance
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 283 def initialize(version, payload, service_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'service_sid' => payload['service_sid'], 'account_sid' => payload['account_sid'], 'unique_name' => payload['unique_name'], 'description' => payload['description'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account that created the resource.
329 330 331 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 329 def account_sid @properties['account_sid'] end |
#buckets ⇒ buckets
Access the buckets
394 395 396 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 394 def buckets context.buckets end |
#context ⇒ RateLimitContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
308 309 310 311 312 313 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 308 def context unless @instance_context @instance_context = RateLimitContext.new(@version, @params['service_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The RFC 2822 date and time in GMT when the resource was created.
347 348 349 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 347 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The RFC 2822 date and time in GMT when the resource was last updated.
353 354 355 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 353 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the RateLimitInstance
387 388 389 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 387 def delete context.delete end |
#description ⇒ String
Returns Description of this Rate Limit.
341 342 343 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 341 def description @properties['description'] end |
#fetch ⇒ RateLimitInstance
Fetch a RateLimitInstance
380 381 382 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 380 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
407 408 409 410 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 407 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.RateLimitInstance #{values}>" end |
#links ⇒ String
Returns The links.
365 366 367 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 365 def links @properties['links'] end |
#service_sid ⇒ String
Returns The SID of the Service that the resource is associated with.
323 324 325 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 323 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns A string that uniquely identifies this Rate Limit.
317 318 319 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 317 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
400 401 402 403 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 400 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.RateLimitInstance #{values}>" end |
#unique_name ⇒ String
Returns A unique, developer assigned name of this Rate Limit.
335 336 337 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 335 def unique_name @properties['unique_name'] end |
#update(description: :unset) ⇒ RateLimitInstance
Update the RateLimitInstance
373 374 375 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 373 def update(description: :unset) context.update(description: description, ) end |
#url ⇒ String
Returns The URL of this resource.
359 360 361 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 359 def url @properties['url'] end |