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
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Rate Limit 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 date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#delete ⇒ Boolean
Delete the RateLimitInstance.
-
#description ⇒ String
Description of this Rate Limit.
-
#fetch ⇒ RateLimitInstance
Fetch the RateLimitInstance.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ RateLimitInstance
constructor
Initialize the RateLimitInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
The URLs of related resources.
-
#service_sid ⇒ String
The SID of the [Service](www.twilio.com/docs/verify/api/service) the resource is associated with.
-
#sid ⇒ String
A 34 character string that uniquely identifies this Rate Limit.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
Provides a unique and addressable name to be assigned to this Rate Limit, assigned by the developer, to be optionally used in addition to SID.
-
#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
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 564 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 || @properties['service_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Rate Limit resource.
611 612 613 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 611 def account_sid @properties['account_sid'] end |
#buckets ⇒ buckets
Access the buckets
683 684 685 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 683 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
590 591 592 593 594 595 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 590 def context unless @instance_context @instance_context = RateLimitContext.new(@version , @params['service_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
629 630 631 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 629 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
635 636 637 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 635 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the RateLimitInstance
654 655 656 657 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 654 def delete context.delete end |
#description ⇒ String
Returns Description of this Rate Limit.
623 624 625 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 623 def description @properties['description'] end |
#fetch ⇒ RateLimitInstance
Fetch the RateLimitInstance
662 663 664 665 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 662 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
696 697 698 699 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 696 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.RateLimitInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of related resources.
647 648 649 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 647 def links @properties['links'] end |
#service_sid ⇒ String
Returns The SID of the [Service](www.twilio.com/docs/verify/api/service) the resource is associated with.
605 606 607 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 605 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this Rate Limit.
599 600 601 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 599 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
689 690 691 692 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 689 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.RateLimitInstance #{values}>" end |
#unique_name ⇒ String
Returns Provides a unique and addressable name to be assigned to this Rate Limit, assigned by the developer, to be optionally used in addition to SID. **This value should not contain PII.**.
617 618 619 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 617 def unique_name @properties['unique_name'] end |
#update(description: :unset) ⇒ RateLimitInstance
Update the RateLimitInstance
671 672 673 674 675 676 677 678 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 671 def update( description: :unset ) context.update( description: description, ) end |
#url ⇒ String
Returns The URL of this resource.
641 642 643 |
# File 'lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb', line 641 def url @properties['url'] end |